rendered paste bodyvoid KPilotDeviceLink::customEvent(QCustomEvent *e)
{
FUNCTIONSETUP;
if ((int)e->type() == EventDeviceReady)
{
DeviceCommEvent* t = dynamic_cast<DeviceCommEvent*>(e);
if (t)
{
fPilotSocket = t->currentSocket();
emit deviceReady( this );
}
else
{
DEBUGKPILOT << fname
<< ": unable to cast event: [" << e << "]" << endl;
}
}
else if ((int)e->type() == EventLogMessage)
{
DeviceCommEvent* t = dynamic_cast<DeviceCommEvent*>(e);
if (t)
{
emit logMessage(t->message());
}
else
{
DEBUGKPILOT << fname
<< ": unable to cast event: [" << e << "]" << endl;
}
}
else if ((int)e->type() == EventLogError)
{
DeviceCommEvent* t = dynamic_cast<DeviceCommEvent*>(e);
if (t)
{
emit logError(t->message());
}
else
{
DEBUGKPILOT << fname
<< ": unable to cast event: [" << e << "]" << endl;
}
}
else if ((int)e->type() == EventLogProgress)
{
DeviceCommEvent* t = dynamic_cast<DeviceCommEvent*>(e);
if (t)
{
emit logProgress(t->message(), t->progress());
}
else
{
DEBUGKPILOT << fname
<< ": unable to cast event: [" << e << "]" << endl;
}
}
else
{
KPilotLink::customEvent(e);
}
}