Bug 29998 - Connecting to signal Tp::TextChannel::chatStateChanged needs typedef if not done in Tp namespace
Summary: Connecting to signal Tp::TextChannel::chatStateChanged needs typedef if not d...
Status: RESOLVED FIXED
Alias: None
Product: Telepathy
Classification: Unclassified
Component: tp-qt (show other bugs)
Version: git master
Hardware: Other All
: medium normal
Assignee: Andre Moreira Magalhaes
QA Contact: Telepathy bugs list
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-09-03 08:15 UTC by Lutz Schoenemann
Modified: 2010-11-16 07:02 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments
patch to the text-channel.h file (838 bytes, patch)
2010-09-03 08:15 UTC, Lutz Schoenemann
Details | Splinter Review

Description Lutz Schoenemann 2010-09-03 08:15:00 UTC
Created attachment 38405 [details] [review]
patch to the text-channel.h file

I have a class in my own namespace and wanted to connect the signal Tp::TextChannel::chatStateChanged(const Tp::ContactPtr &, ChannelChatState) to a slot of this class 
MyNamespace::MyClass::onChatStateChanged(const Tp::ContactPtr &, Tp::ChannelChatState).

I have tried it with 3 different connects:
1. connect( channel, SIGNAL(chatStateChanged(Tp::ContactPtr, ChannelChatState)), SLOT(onChatStateChanged(Tp::ContactPtr, Tp::ChannelChatState)) );
2. connect( channel, SIGNAL(chatStateChanged(Tp::ContactPtr, Tp::ChannelChatState)), SLOT(onChatStateChanged(Tp::ContactPtr, Tp::ChannelChatState)) );
3. connect( channel, SIGNAL(chatStateChanged(Tp::ContactPtr, ChannelChatState)), SLOT(onChatStateChanged(Tp::ContactPtr, ChannelChatState)) );

the first wasn't possible because the meta-object system complains about not compatible types (ChannelChatState != Tp::ChannelChatState)
the second wasn't possible because the meta-object system wasn't able to find that signal
the third wasn't possible because the meta-object system wasn't able to find the slot

Finally I was able to connect the signal to the slot by using this typedef:
typedef Tp::ChannelChatState ChannelChatState
and the 3rd version of the connects
3. connect( channel, SIGNAL(chatStateChanged(Tp::ContactPtr, ChannelChatState)), SLOT(onChatStateChanged(Tp::ContactPtr, ChannelChatState)) );


It would be a lot easier to change the header by adding the namespace Tp:: in front of ChannelChatState type
Comment 1 Olli Salli 2010-11-05 01:06:35 UTC
Will be fixed in 0.5.0.
Comment 2 Olli Salli 2010-11-16 07:02:38 UTC
Fix merged to master. Will be in 0.5.0.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.