convert methods to actions where it makes sense

QAmqpExchange and QAmqpQueue both have a number of actions associated
with them that should be defined as slots (especially for a potential
future where they are exported as QML objects). This is a step in the
direction of fully making these classes scriptable
This commit is contained in:
Matt Broadstone 2015-02-15 16:36:16 -05:00
parent d45f5b09d6
commit 3c2a039c08
3 changed files with 25 additions and 22 deletions

View File

@ -71,6 +71,17 @@ public:
bool isDeclared() const; bool isDeclared() const;
void enableConfirms(bool noWait = false);
bool waitForConfirms(int msecs = 30000);
Q_SIGNALS:
void declared();
void removed();
void confirmsEnabled();
void allMessagesDelivered();
public Q_SLOTS:
// AMQP Exchange // AMQP Exchange
void declare(ExchangeType type = Direct, void declare(ExchangeType type = Direct,
ExchangeOptions options = NoOptions, ExchangeOptions options = NoOptions,
@ -92,16 +103,6 @@ public:
const QAmqpMessage::PropertyHash &properties = QAmqpMessage::PropertyHash(), const QAmqpMessage::PropertyHash &properties = QAmqpMessage::PropertyHash(),
int publishOptions = poNoOptions); int publishOptions = poNoOptions);
void enableConfirms(bool noWait = false);
bool waitForConfirms(int msecs = 30000);
Q_SIGNALS:
void declared();
void removed();
void confirmsEnabled();
void allMessagesDelivered();
protected: protected:
virtual void channelOpened(); virtual void channelOpened();
virtual void channelClosed(); virtual void channelClosed();

View File

@ -7,6 +7,7 @@ QAmqpMessagePrivate::QAmqpMessagePrivate()
: deliveryTag(0), : deliveryTag(0),
leftSize(0) leftSize(0)
{ {
qRegisterMetaType<QAmqpMessage::PropertyHash>("QAmqpMessage::PropertyHash");
} }
////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////

View File

@ -74,6 +74,19 @@ public:
void setConsumerTag(const QString &consumerTag); void setConsumerTag(const QString &consumerTag);
QString consumerTag() const; QString consumerTag() const;
Q_SIGNALS:
void declared();
void bound();
void unbound();
void removed();
void purged(int messageCount);
void messageReceived();
void empty();
void consuming(const QString &consumerTag);
void cancelled(const QString &consumerTag);
public Q_SLOTS:
// AMQP Queue // AMQP Queue
void declare(int options = Durable|AutoDelete); void declare(int options = Durable|AutoDelete);
void bind(const QString &exchangeName, const QString &key); void bind(const QString &exchangeName, const QString &key);
@ -92,18 +105,6 @@ public:
void reject(const QAmqpMessage &message, bool requeue); void reject(const QAmqpMessage &message, bool requeue);
void reject(qlonglong deliveryTag, bool requeue); void reject(qlonglong deliveryTag, bool requeue);
Q_SIGNALS:
void declared();
void bound();
void unbound();
void removed();
void purged(int messageCount);
void messageReceived();
void empty();
void consuming(const QString &consumerTag);
void cancelled(const QString &consumerTag);
protected: protected:
// reimp Channel // reimp Channel
virtual void channelOpened(); virtual void channelOpened();