changed some variable names for clarity and readability
This commit is contained in:
parent
27d8329065
commit
81f9437495
|
|
@ -22,14 +22,14 @@ public Q_SLOTS:
|
||||||
|
|
||||||
private Q_SLOTS:
|
private Q_SLOTS:
|
||||||
void clientConnected() {
|
void clientConnected() {
|
||||||
Exchange *exchange = m_client.createExchange("direct_logs");
|
Exchange *direct_logs = m_client.createExchange("direct_logs");
|
||||||
connect(exchange, SIGNAL(declared()), this, SLOT(exchangeDeclared()));
|
connect(direct_logs, SIGNAL(declared()), this, SLOT(exchangeDeclared()));
|
||||||
exchange->declare(Exchange::Direct);
|
direct_logs->declare(Exchange::Direct);
|
||||||
}
|
}
|
||||||
|
|
||||||
void exchangeDeclared() {
|
void exchangeDeclared() {
|
||||||
Exchange *exchange = qobject_cast<Exchange*>(sender());
|
Exchange *direct_logs = qobject_cast<Exchange*>(sender());
|
||||||
if (!exchange)
|
if (!direct_logs)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
QStringList args = qApp->arguments();
|
QStringList args = qApp->arguments();
|
||||||
|
|
@ -44,7 +44,7 @@ private Q_SLOTS:
|
||||||
message = "Hello World!";
|
message = "Hello World!";
|
||||||
}
|
}
|
||||||
|
|
||||||
exchange->publish(message, severity);
|
direct_logs->publish(message, severity);
|
||||||
qDebug(" [x] Sent %s:%s", severity.toLatin1().constData(), message.toLatin1().constData());
|
qDebug(" [x] Sent %s:%s", severity.toLatin1().constData(), message.toLatin1().constData());
|
||||||
m_client.disconnectFromHost();
|
m_client.disconnectFromHost();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -7,11 +7,11 @@
|
||||||
#include "amqp_queue.h"
|
#include "amqp_queue.h"
|
||||||
using namespace QAMQP;
|
using namespace QAMQP;
|
||||||
|
|
||||||
class LogReceiver : public QObject
|
class DirectLogReceiver : public QObject
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
LogReceiver(QObject *parent = 0) : QObject(parent) {}
|
DirectLogReceiver(QObject *parent = 0) : QObject(parent) {}
|
||||||
|
|
||||||
public Q_SLOTS:
|
public Q_SLOTS:
|
||||||
void start(const QStringList &severities) {
|
void start(const QStringList &severities) {
|
||||||
|
|
@ -76,7 +76,7 @@ int main(int argc, char **argv)
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
LogReceiver logReceiver;
|
DirectLogReceiver logReceiver;
|
||||||
logReceiver.start(severities);
|
logReceiver.start(severities);
|
||||||
return app.exec();
|
return app.exec();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue