Commit b92c4771 authored by jpbl's avatar jpbl
Browse files

fixed the hangup

parent f8e318c7
......@@ -11,6 +11,13 @@ Event::Event(const std::string &code,
, mArgs(args)
{}
void
Event::execute()
{
_debug("Received: %s.\n", toString().c_str());
}
std::string
Event::toString()
{
......
......@@ -31,7 +31,7 @@ public:
const std::list< std::string > &args);
virtual ~Event(){}
virtual void execute(){};
virtual void execute();
virtual std::string toString();
......
......@@ -21,7 +21,7 @@ PhoneLineManagerImpl::PhoneLineManagerImpl()
void
PhoneLineManagerImpl::connect()
{
mSession.getEvents();
//mSession.getEvents();
}
......
......@@ -45,13 +45,14 @@ TCPSessionIO::~TCPSessionIO()
void
TCPSessionIO::askReconnect()
{
_debug("TCPSessionIO: Link broken.\n");
int ret = QMessageBox::critical(NULL,
tr("SFLPhone disconnected"),
tr("The link between SFLPhone and SFLPhoned is broken.\n"
"Do you want to try to reconnect?"),
QMessageBox::Retry | QMessageBox::Default,
QMessageBox::Cancel | QMessageBox::Escape);
if (ret == QMessageBox::Yes) {
if (ret == QMessageBox::Retry) {
connect();
}
}
......@@ -84,7 +85,6 @@ void
TCPSessionIO::sendWaitingRequests()
{
_debug("TCPSessionIO: Connected.\n");
_debug("TCPSessionIO: Sending waiting data.\n");
QTextStream stream(mSocket);
QMutexLocker guard(&mStackMutex);
while(mSocket->state() == QAbstractSocket::ConnectedState &&
......@@ -92,7 +92,10 @@ TCPSessionIO::sendWaitingRequests()
stream << *mStack.begin();
mStack.pop_front();
}
emit connected();
if(mSocket->state() == QAbstractSocket::ConnectedState) {
emit connected();
}
}
void
......
......@@ -11,8 +11,8 @@ TCPSessionIO *
TCPSessionIOCreator::create()
{
TCPSessionIO *t = new TCPSessionIO(mHostname, mPort);
QObject::connect(t, SIGNAL(connected()),
&PhoneLineManager::instance(), SLOT(connect()));
//QObject::connect(t, SIGNAL(connected()),
// &PhoneLineManager::instance(), SLOT(connect()));
t->connect();
return t;
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment