Source message user data can now be copyied in postponed message.
git-svn-id: http://yate.null.ro/svn/yate/trunk@2540 acf43c95-373e-0410-b603-e72c3f656dc1
This commit is contained in:
parent
13cc53ff77
commit
14fea4a0d1
|
@ -105,9 +105,11 @@ private:
|
||||||
class PostponedMessage : public Message
|
class PostponedMessage : public Message
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
inline PostponedMessage(const Message& msg, int id)
|
inline PostponedMessage(const Message& msg, int id, bool copyUserData)
|
||||||
: Message(msg), m_id(id)
|
: Message(msg), m_id(id) {
|
||||||
{ }
|
if (copyUserData)
|
||||||
|
userData(msg.userData());
|
||||||
|
}
|
||||||
inline int id() const
|
inline int id() const
|
||||||
{ return m_id; }
|
{ return m_id; }
|
||||||
private:
|
private:
|
||||||
|
@ -1761,11 +1763,11 @@ bool Client::received(Message& msg, int id)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Postpone messages to be redispatched from UI thread
|
// Postpone messages to be redispatched from UI thread
|
||||||
bool Client::postpone(const Message& msg, int id)
|
bool Client::postpone(const Message& msg, int id, bool copyUserData)
|
||||||
{
|
{
|
||||||
if (isCurrent())
|
if (isCurrent())
|
||||||
return false;
|
return false;
|
||||||
PostponedMessage* postponed = new PostponedMessage(msg,id);
|
PostponedMessage* postponed = new PostponedMessage(msg,id,copyUserData);
|
||||||
s_postponeMutex.lock();
|
s_postponeMutex.lock();
|
||||||
s_postponed.append(postponed);
|
s_postponed.append(postponed);
|
||||||
s_postponeMutex.unlock();
|
s_postponeMutex.unlock();
|
||||||
|
|
|
@ -1072,9 +1072,10 @@ public:
|
||||||
* Postpone a copy of a message to be dispatched from the UI thread
|
* Postpone a copy of a message to be dispatched from the UI thread
|
||||||
* @param msg Message to be postponed
|
* @param msg Message to be postponed
|
||||||
* @param id Identifier of the message to be used on dispatch
|
* @param id Identifier of the message to be used on dispatch
|
||||||
|
* @param copyUserData Copy source user data in postponed message
|
||||||
* @return True if the UI thread was not current so the message was postponed
|
* @return True if the UI thread was not current so the message was postponed
|
||||||
*/
|
*/
|
||||||
bool postpone(const Message& msg, int id);
|
bool postpone(const Message& msg, int id, bool copyUserData = false);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Show a file open dialog window
|
* Show a file open dialog window
|
||||||
|
|
Loading…
Reference in New Issue