Bug 31200

Summary: Windows portability patches for telepathy-qt4
Product: Telepathy Reporter: Thomas Flüeli <tflueeli>
Component: tp-qtAssignee: Andre Moreira Magalhaes <andrunko>
Status: RESOLVED MOVED QA Contact: Telepathy bugs list <telepathy-bugs>
Severity: normal    
Priority: medium Keywords: patch
Version: git master   
Hardware: Other   
OS: Windows (All)   
Whiteboard:
i915 platform: i915 features:
Attachments: patch 1
patch 2
patch 3
patch 4
patch 5

Description Thomas Flüeli 2010-10-28 07:41:06 UTC
Created attachment 39858 [details] [review]
patch 1

I've made some changes to get telepathy-qt4 compile with MSVC 9.
Comment 1 Thomas Flüeli 2010-10-28 07:41:24 UTC
Created attachment 39859 [details] [review]
patch 2
Comment 2 Thomas Flüeli 2010-10-28 07:41:45 UTC
Created attachment 39860 [details] [review]
patch 3
Comment 3 Thomas Flüeli 2010-10-28 07:42:05 UTC
Created attachment 39861 [details] [review]
patch 4
Comment 4 Thomas Flüeli 2010-10-28 07:42:19 UTC
Created attachment 39862 [details] [review]
patch 5
Comment 5 Simon McVittie 2010-10-29 05:28:08 UTC
Review of attachment 39859 [details] [review]:

::: TelepathyQt4/capabilities-base.cpp
@@ -161,3 @@
     uint targetHandleType;
     foreach (const RequestableChannelClass &cls, mPriv->classes) {
-        if (!cls.fixedProperties.size() == 2) {

This looks like a real bug, in fact; the precedence isn't what the author of this code expected.

The fix should be "if (blahblah.size() != 2)", though :-)
Comment 6 Andre Moreira Magalhaes 2010-10-29 05:44:11 UTC
(In reply to comment #5)
> Review of attachment 39859 [details] [review]:
> 
> ::: TelepathyQt4/capabilities-base.cpp
> @@ -161,3 @@
>      uint targetHandleType;
>      foreach (const RequestableChannelClass &cls, mPriv->classes) {
> -        if (!cls.fixedProperties.size() == 2) {
> 
> This looks like a real bug, in fact; the precedence isn't what the author of
> this code expected.
> 
> The fix should be "if (blahblah.size() != 2)", though :-)
Ooops :D. I fixed this in my rcc-high-level branch that should be merged any time soon.
Comment 7 Andre Moreira Magalhaes 2010-10-29 05:45:48 UTC
(In reply to comment #0)
> Created an attachment (id=39858) [details]
> patch 1
> 
> I've made some changes to get telepathy-qt4 compile with MSVC 9.

This is fixed in my lib-enable-deprecation-warns branch. The correct would be DEPRECATED instead of EXPORT, probably copy/paste error. It's just waiting for review.
Comment 8 Andre Moreira Magalhaes 2010-10-29 05:48:49 UTC
> Created an attachment (id=39860) [details]
> patch 3

Why do you need that? QString has a constructor taking a QL1S
Comment 9 Andre Moreira Magalhaes 2010-10-29 05:53:02 UTC
(In reply to comment #3)
> Created an attachment (id=39861) [details]
> patch 4

The public API for qdbus_cast only receives 1 param, I wonder why this does not work for you, or even worst, works by passing a new param.
Comment 10 Andre Moreira Magalhaes 2010-10-29 05:58:05 UTC
(In reply to comment #4)
> Created an attachment (id=39862) [details]
> patch 5

This is a bug in tp-qt4, these methods should have never being exported. We will fix this for 0.5.0 (API break version) that should be out next month.
Comment 11 Thomas Flüeli 2010-10-30 10:05:28 UTC
(In reply to comment #8)
 
> Why do you need that? QString has a constructor taking a QL1S

Sorry I forgot to explain that in the commit message. The reason for this patch is basically the most vexing parse. MSVC treats the constructor invocation as a function declaration and fails with this error message:

channel.h(244) : error C2751: 'Tp::Client::ChannelTypeContactSearchInterface::staticInterfaceName' : the name of a function parameter cannot be qualified
see reference to function template instantiation 'Interface *Tp::Channel::typeInterface<Tp::Client::ChannelTypeContactSearchInterface>(Tp::OptionalInterfaceFactory<DBusProxySubclass>::InterfaceSupportedChecking) const' being compiled
Comment 12 Thomas Flüeli 2010-10-30 10:55:57 UTC
(In reply to comment #9)

> The public API for qdbus_cast only receives 1 param, I wonder why this does not
> work for you, or even worst, works by passing a new param.

Actually qdbus_cast receives 2 parameters, but the second one is excluded from the API documentation:

template<typename T> inline T qdbus_cast(const QDBusArgument &arg
#ifndef Q_QDOC
, T * = 0
#endif
    )
Comment 13 Thomas Flüeli 2010-10-31 03:29:49 UTC
(In reply to comment #11)

Another way to work around the problem is to use an additional set of parenthesis:

QString name((QLatin1String(Interface::staticInterfaceName())));
Comment 14 Olli Salli 2010-11-05 01:09:45 UTC
It would occur to me you're working on this already, Andre :)
Comment 15 GitLab Migration User 2019-12-03 20:27:52 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/telepathy/telepathy-qt/issues/12.

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.