Move skproto timer in the same thread

parent 0172fe95
......@@ -45,6 +45,11 @@ void SkyliveAuth::startPlugin()
}
void SkyliveAuth::pluginKicked()
{
}
void SkyliveAuth::receiveMessage(SKMessage msg)
{
std::cout << "SkyliveAuth msg received: " << msg.handle.toStdString() << std::endl;
......
......@@ -66,6 +66,7 @@ class SkyliveAuth : public QObject, SkylivexPluginInterface
public slots:
void receiveMessage(SKMessage msg);
void pluginKicked();
signals:
void putMessage(SKMessage msg);
......
......@@ -49,13 +49,19 @@ void SkyliveProtocol::startPlugin()
registerHandler((QString)"connectTelescopes", &SkyliveProtocol::handle_connect);
registerHandler((QString)"putlogin", &SkyliveProtocol::handle_putlogin);
pktTimer = new QTimer();
QObject::connect(pktTimer, SIGNAL(timeout()), this, SLOT(processPackets()));
//pktTimer = new QTimer();
//QObject::connect(pktTimer, SIGNAL(timeout()), this, SLOT(processPackets()));
//pktTimer->start();
}
void SkyliveProtocol::pluginKicked()
{
pktTimer = new QTimer();
QObject::connect(pktTimer, SIGNAL(timeout()), this, SLOT(processPackets()));
pktTimer->start();
}
void SkyliveProtocol::sendPacket(QString &cmd, QList<QString> &paramlist)
{
......
......@@ -120,6 +120,7 @@ class SkyliveProtocol : public QObject, SkylivexPluginInterface
void displayError(QAbstractSocket::SocketError);
public slots:
void pluginKicked();
void receiveMessage(SKMessage msg);
private slots:
......
......@@ -79,6 +79,7 @@ void SkyliveX::loadPlugins()
std::cout << plugin << std::endl;
}
}
emit kickPlugins();
SKMessage msg("coreStarted");
sendMessage(msg);
}
......@@ -89,6 +90,7 @@ void SkyliveX::initializePlugin(QObject *plugin, QString filename)
// connect signals/slots
connect(plugin, SIGNAL(putMessage(SKMessage)), this, SLOT(receiveFromPlugins(SKMessage)));
connect(this, SIGNAL(msgForPlugins(SKMessage)), plugin, SLOT(receiveMessage(SKMessage)));
connect(this, SIGNAL(kickPlugins()), plugin, SLOT(pluginKicked()));
// Move the plugin in it's own thread
QThread* consumer = new QThread();
......
......@@ -71,6 +71,7 @@ class SkyliveX : public QObject
signals:
void finished();
void kickPlugins();
void msgForMainWin(SKMessage &msg);
void msgForPlugins(SKMessage msg);
};
......
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