[Bug 29998] New: Connecting to signal Tp::TextChannel::chatStateChanged needs typedef if not done in Tp namespace
bugzilla-daemon at freedesktop.org
bugzilla-daemon at freedesktop.org
Fri Sep 3 17:15:01 CEST 2010
https://bugs.freedesktop.org/show_bug.cgi?id=29998
Summary: Connecting to signal Tp::TextChannel::chatStateChanged
needs typedef if not done in Tp namespace
Product: Telepathy
Version: git master
Platform: Other
OS/Version: All
Status: NEW
Severity: normal
Priority: medium
Component: tp-qt4
AssignedTo: telepathy-bugs at lists.freedesktop.org
ReportedBy: lutz.schoenemann at basyskom.de
QAContact: telepathy-bugs at lists.freedesktop.org
Created an attachment (id=38405)
View: https://bugs.freedesktop.org/attachment.cgi?id=38405
Review: https://bugs.freedesktop.org/review?bug=29998&attachment=38405
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
--
Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.
More information about the telepathy-bugs
mailing list