[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-core-devel
Subject: Re: kconfiggroup and unhandled types
From: "Thomas Braxton" <kde.braxton () gmail ! com>
Date: 2007-10-29 8:59:32
Message-ID: 928c3f1b0710290159y197dad00yb9c2f0a0a1e645c2 () mail ! gmail ! com
[Download RAW message or body]
On 10/29/07, Thiago Macieira <thiago@kde.org> wrote:
>
> Em Monday 29 October 2007 05:20:34 Aaron J. Seigo escreveu:
> > were there specific reasons for using kFatal that warrant keeping it
> that
> > way?
>
> I agree that kWarning is probably better.
>
> If you're debugging your code and you want to fix your warnings, do this:
>
> export QT_FATAL_WARNINGS=1
>
> This will generate core dumps when a warning is triggered. The same
> behaviour
> as a kFatal, that is.
I didn't know about that. So, how about this patch?
Index: kconfiggroup.cpp
===================================================================
--- kconfiggroup.cpp (revision 730534)
+++ kconfiggroup.cpp (working copy)
@@ -346,7 +346,7 @@
}
case QVariant::Color:
case QVariant::Font:
- kFatal() << "KConfigGroup::readEntry was passed GUI type '"
+ kWarning() << "KConfigGroup::readEntry was passed GUI type '"
<< aDefault.typeName()
<< "' but kdeui isn't linked! If it is linked to your
program, "
"this is a platform bug. Please inform the KDE
developers" << endl;
@@ -362,7 +362,7 @@
break;
}
- kFatal() << "unhandled type " << aDefault.typeName();
+ kWarning() << "unhandled type " << aDefault.typeName();
return QVariant();
}
@@ -1103,7 +1103,7 @@
case QVariant::Color:
case QVariant::Font:
- kFatal() << "KConfigGroup::writeEntry was passed GUI type '"
+ kWarning() << "KConfigGroup::writeEntry was passed GUI type '"
<< value.typeName()
<< "' but kdeui isn't linked! If it is linked to your
program, this is a platform bug. "
"Please inform the KDE developers" << endl;
@@ -1116,7 +1116,7 @@
data = qvariant_cast<KUrl>(value).url().toUtf8();
break;
}
- kFatal() << "KConfigGroup::writeEntry - unhandled type" <<
value.typeName() << "in group" << name();
+ kWarning() << "KConfigGroup::writeEntry - unhandled type" <<
value.typeName() << "in group" << name();
}
writeEntry(key, data, flags);
[Attachment #3 (text/html)]
<br><br><div><span class="gmail_quote">On 10/29/07, <b \
class="gmail_sendername">Thiago Macieira</b> <<a \
href="mailto:thiago@kde.org">thiago@kde.org</a>> wrote:</span><blockquote \
class="gmail_quote" style="margin:0;margin-left:0.8ex;border-left:1px #ccc \
solid;padding-left:1ex"> Em Monday 29 October 2007 05:20:34 Aaron J. Seigo \
escreveu:<br>> were there specific reasons for using kFatal that warrant keeping \
it that<br>> way?<br><br>I agree that kWarning is probably better.<br><br>If \
you're debugging your code and you want to fix your warnings, do this: \
<br><br> export \
QT_FATAL_WARNINGS=1<br><br>This will generate core dumps when a warning is triggered. \
The same behaviour<br>as a kFatal, that is.</blockquote><div><br \
class="webkit-block-placeholder"></div><div>I didn't know about that. So, how \
about this patch? </div><div><br \
class="webkit-block-placeholder"></div><div><div>Index: \
kconfiggroup.cpp</div><div>===================================================================</div><div>--- \
kconfiggroup.cpp<span class="Apple-tab-span" style="white-space:pre"> \
</span>(revision 730534)</div><div>+++ kconfiggroup.cpp<span class="Apple-tab-span" \
style="white-space:pre"> </span>(working copy)</div><div>@@ -346,7 +346,7 \
@@</div><div> }</div><div> \
case QVariant::Color: </div><div> case \
QVariant::Font:</div><div>- kFatal() \
<< "KConfigGroup::readEntry was passed GUI type '"</div><div>+ \
kWarning() << \
"KConfigGroup::readEntry was passed GUI type '" </div><div> \
<< \
aDefault.typeName()</div><div> \
<< "' but kdeui isn't linked! If it is linked \
to your program, "</div><div> \
"this is a platform bug. Please inform the KDE \
developers" << endl; </div><div>@@ -362,7 +362,7 @@</div><div> \
break;</div><div> \
}</div><div> </div><div>- kFatal() << "unhandled type \
" << aDefault.typeName();</div><div>+ kWarning() << \
"unhandled type " << aDefault.typeName();</div><div> \
return QVariant();</div><div> }</div><div> </div><div>@@ -1103,7 \
+1103,7 @@</div><div> </div><div> case \
QVariant::Color:</div><div> case \
QVariant::Font:</div><div>- kFatal() \
<< "KConfigGroup::writeEntry was passed GUI type '" </div><div>+ \
kWarning() << \
"KConfigGroup::writeEntry was passed GUI type '"</div><div> \
<< \
value.typeName()</div><div> \
<< "' but kdeui isn't linked! If it is \
linked to your program, this is a platform bug. " </div><div> \
"Please \
inform the KDE developers" << endl;</div><div>@@ -1116,7 +1116,7 \
@@</div><div> data = \
qvariant_cast<KUrl>(value).url().toUtf8();</div><div> \
break;</div><div> \
}</div><div>- kFatal() \
<< "KConfigGroup::writeEntry - unhandled type" << \
value.typeName() << "in group" << name();</div> <div>+ \
kWarning() << "KConfigGroup::writeEntry \
- unhandled type" << value.typeName() << "in group" \
<< name();</div><div> \
}</div><div> </div><div> writeEntry(key, data, flags); \
</div><br> </div></div>
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic