[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    Re: [kdelibs4support] src/kdecore: Fix build with Qt 5.5
From:       Daniel =?ISO-8859-1?Q?Vr=E1til?= <dvratil () redhat ! com>
Date:       2015-03-02 10:13:03
Message-ID: 1779641.svTy2zuvXB () thor
[Download RAW message or body]


On Friday, February 27, 2015 08:13:26 PM David Faure wrote:
> On Friday 27 February 2015 18:31:51 Dan Vrátil wrote:
> > Git commit bbae94f31548082c0e8c8952e4883da3b22fe3a0 by Dan Vrátil.
> > Committed on 27/02/2015 at 18:30.
> > Pushed by dvratil into branch 'master'.
> > 
> > Fix build with Qt 5.5
> > 
> > QTime ctor is not explicit, and since 5.5 it's constexpr, which probably
> > confuses compiler in which KDateTime ctor overload it should pick.
> > 
> > BUG: 344193
> > FIXED-IN: 5.8.0
> > 
> > M  +1    -1    src/kdecore/kdatetime.cpp
> > 
> > http://commits.kde.org/kdelibs4support/bbae94f31548082c0e8c8952e4883da3b22
> > fe 3a0
> > 
> > diff --git a/src/kdecore/kdatetime.cpp b/src/kdecore/kdatetime.cpp
> > index 8ea0101..74d1815 100644
> > --- a/src/kdecore/kdatetime.cpp
> > +++ b/src/kdecore/kdatetime.cpp
> > @@ -943,7 +943,7 @@ KDateTime KDateTime::toUtc() const
> > 
> >          return *this;
> >      
> >      }
> >      if (d->dateOnly()) {
> > 
> > -        return KDateTime(d->date(), UTC);
> > +        return KDateTime(d->date(), Spec(UTC));
> > 
> >      }
> >      QDateTime udt = d->toUtc();
> >      if (!udt.isValid()) {
> 
> Would it help to add another KDateTime overload then? To avoid this SIC?

I'm not sure if an overload would help: if I understand it correctly, it's 
because compiler is able to convert KDateTime::SpecType enum to both 
QTime(int) and KDateTime::Spec(KDateTime::SpecType), leading to ambiguity 
between KDateTime::KDateTime(const QDate &date, const QTime &time, Spec &spec 
= Spec(LocalZone))  and KDateTime::KDateTime(const QDate &date, const 
KDateTime::Spec &spec).

I tried adding KDateTime::KDateTime(QDate, KDateTime::SpecType) overload, but 
that only extends the ambiguity...

If you have another idea, I'd be happy to write a patch :)

Cheers,
Daniel




-- 
Daniel Vrátil | dvratil@redhat.com | dvratil on #kde-devel, #kontact, #akonadi
Software Engineer - KDE Desktop Team, Red Hat Inc.

GPG Key: 0xC59D614F6F4AE348
Fingerprint: 4EC1 86E3 C54E 0B39 5FDD B5FB C59D 614F 6F4A E348
["signature.asc" (application/pgp-signature)]

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic