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

List:       kde-commits
Subject:    Re: [kdepim-runtime/frameworks] /: kdebug--
From:       "David Jarvie" <djarvie () kde ! org>
Date:       2014-08-06 11:22:40
Message-ID: 6b0f3493080a3df2fb9d973ce5dcb4f8.squirrel () www6 ! sensical ! net
[Download RAW message or body]

On Wed, August 6, 2014 6:56 am, laurent Montel wrote:
> Le mardi 5 août 2014 09:29:08 vous avez écrit :
>> On Tue, August 5, 2014 7:29 am, laurent Montel wrote:
>> > Le lundi 4 août 2014 17:44:28 David Jarvie a écrit :
>> >> On Mon, August 4, 2014 6:20 am, Montel Laurent wrote:
>> >> > Git commit 312b3e276ba6dee92a671f0eccf9d4f81ab03f40 by Montel
>> Laurent.
>> >> > Committed on 04/08/2014 at 05:20.
>> >> > Pushed by mlaurent into branch 'frameworks'.
>> >> >
>> >> > kdebug--
>> >> >
>> >> > M  +1    -1    kioslave/akonadislave.cpp
>> >> > M  +2    -2    plugins/CMakeLists.txt
>> >> > M  +8    -7    plugins/akonadi_serializer_kalarm.cpp
>> >> > A  +23   -0    plugins/akonadi_serializer_kalarm_debug.cpp
>> >>
>> >> [License:
>> >> > LGPL (v2+)]
>> >> > A  +27   -0    plugins/akonadi_serializer_kalarm_debug.h
>> [License:
>> >> > LGPL (v2+)]
>> >> > M  +4    -3    plugins/akonadi_serializer_mail.cpp
>> >> > A  +23   -0    plugins/akonadi_serializer_mail_debug.cpp
>> [License:
>> >> > LGPL (v2+)]
>> >>
>> >> > A  +27   -0    plugins/akonadi_serializer_mail_debug.h
>> [License:
>> >> LGPL
>> >>
>> >> > (v2+)]
>> >> > M  +1    -1    plugins/autotests/CMakeLists.txt
>> >> > M  +2    -2    resources/maildir/autotests/synctest.cpp
>> >> > M  +5    -5    resources/maildir/libmaildir/keycache.cpp
>> >> > M  +21   -20   resources/maildir/maildirresource.cpp
>> >> >
>> >> > http://commits.kde.org/kdepim-runtime/312b3e276ba6dee92a671f0eccf9d4f81
>> >> > ab0
>> >> > 3f40
>> >>
>> >> ...
>> >>
>> >> > diff --git a/plugins/akonadi_serializer_kalarm.cpp
>> >> > b/plugins/akonadi_serializer_kalarm.cpp
>> >> > index b87a67c..a0c144c 100644
>> >> > --- a/plugins/akonadi_serializer_kalarm.cpp
>> >> > +++ b/plugins/akonadi_serializer_kalarm.cpp
>> >>
>> >> ...
>> >>
>> >> > @@ -81,7 +82,7 @@ bool SerializerPluginKAlarm::deserialize(Item&
>> item,
>> >> > const QByteArray& label, QI
>> >> >
>> >> >      {
>> >> >
>> >> >          Attribute* a = item.attribute(dummy.type());
>> >> >          if (!a)
>> >> >
>> >> > -            kError(5954) << "deserialize(): Event with uid" <<
>> >>
>> >> event.id()
>> >>
>> >> > << "contains null attribute";
>> >> > +            qCCritical(AKONADI_SERIALIZER_KALARM_LOG) <<
>> >>
>> >> "deserialize():
>> >> > Event with uid" << event.id() << "contains null attribute";
>> >> >
>> >> >          else
>> >> >          {
>> >> >
>> >> >              EventAttribute* evAttr =
>> >>
>> >> dynamic_cast<EventAttribute*>(a);
>> >>
>> >> Is it correct to replace kError() with qCCritical()? kError() isn't
>> >> fatal,
>> >> but my reading of the Qt documentation is that qCCritical() *is*
>> fatal.
>> >> Because qCError() doesn't exist, shouldn't kError() be replaced by
>> >> qCWarning()?
>> >
>> > Good question.
>> > There is a qFatal but not a qCFatal.
>> > So what is the diff between kError and kWarning ?
>>
>> I try to follow the distinction made by KMessageBox - an error is when
>> the
>> program has done something wrong, while a warning is when something
>> significant has happened that needs to be drawn attention to, perhaps a
>> user error or some other problem which can be expected on occasion.
>
> For me qCritical is not fatal
> See "
> qCritical() << "Shortcut for action " << action->objectName() << action-
>>text() << "set with QAction::setShortcut()! Use
> KActionCollection::setDefaultShortcut(s) instead.";
> "
> And I have all the time it and it's not fatal.
> Are you sure that it's fatal ?

The word "critical" sounds extremely serious, and suggests that it's an
error which can't be recovered from. Also, I saw the statement in the Qt
documentation that qCritical() exits if QT_FATAL_CRITICALS is not empty,
and assumed that that would be the default. However, I see that there is
also a qFatal() function, so my assumption was probably wrong. In that
case, you were correct to change kError() to qCCritical().

I think that calling the function qCritical was a bad choice of name,
because it's misleading.

-- 
David Jarvie.
KDE developer.
KAlarm author - http://www.astrojar.org.uk/kalarm

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

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