Bug 226314 - Impossibility of KConfigGroup::readEntry to evaluate to false in boolean context
Summary: Impossibility of KConfigGroup::readEntry to evaluate to false in boolean context
Status: RESOLVED WORKSFORME
Alias: None
Product: kdelibs
Classification: Frameworks and Libraries
Component: kdecore (show other bugs)
Version: unspecified
Platform: openSUSE Linux
: NOR normal
Target Milestone: ---
Assignee: kdelibs bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-02-11 14:21 UTC by Holger Müller
Modified: 2023-01-14 05:11 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Holger Müller 2010-02-11 14:21:01 UTC
Version:            (using KDE 4.3.5)
OS:                Linux
Installed from:    openSUSE RPMs

It seems that is is impossible to get a false value
if KConfigGroup::readEntry is called in boolean context and
shell expansion is used.

I've set $foo to "false" in environment and set NoDisplay[$e]=$foo
in a test Desktopfile

    const KConfigGroup group = kdf.group("Desktop Entry");

    qDebug() << "readEntry ( \"NoDisplay\", true ): " <<
            group.readEntry("NoDisplay", true);
    qDebug() << "readEntry ( \"NoDisplay\", false ): " <<
            group.readEntry("NoDisplay", false);
    qDebug() << "readEntry ( \"NoDisplay\", \"false\" ): " <<
            group.readEntry("NoDisplay", "false");

readEntry ( "NoDisplay", true ):  true
readEntry ( "NoDisplay", false ):  true
readEntry ( "NoDisplay", "false" ):  "false"

So it seems impossible to use the expand feature for boolean values.
I consider this as a bug.

See also bug entry 225255

Regards Holger
Comment 1 Holger Müller 2010-02-11 14:23:27 UTC
Other values tried for $foo:

unset foo
foo=0
foo=-1
foo=1

always the same result.
Comment 2 Holger Müller 2010-03-12 16:33:31 UTC
It isn't only a problem of the boolean context, it's a general problem with
expand and default values.

Expanding in QString context with empty output of evaluation function will
deliver "" as string and not the suggested default.
Comment 3 David Faure 2010-12-08 23:21:24 UTC
probably the same as bug 225255 then?
Comment 4 Andrew Crouthamel 2018-11-05 03:15:37 UTC
Dear Bug Submitter,

This bug has been stagnant for a long time. Could you help us out and re-test if the bug is valid in the latest version? I am setting the status to NEEDSINFO pending your response, please change the Status back to REPORTED when you respond.

Thank you for helping us make KDE software even better for everyone!
Comment 5 Andrew Crouthamel 2018-11-17 04:58:57 UTC
Dear Bug Submitter,

This is a reminder that this bug has been stagnant for a long time. Could you help us out and re-test if the bug is valid in the latest version? This bug will be moved back to REPORTED Status for manual review later, which may take a while. If you are able to, please lend us a hand.

Thank you for helping us make KDE software even better for everyone!
Comment 6 Justin Zobel 2022-12-15 05:48:50 UTC
Thank you for reporting this issue in KDE software. As it has been a while since this issue was reported, can we please ask you to see if you can reproduce the issue with a recent software version?

If you can reproduce the issue, please change the status to "REPORTED" when replying. Thank you!
Comment 7 Bug Janitor Service 2022-12-30 05:22:35 UTC
Dear Bug Submitter,

This bug has been in NEEDSINFO status with no change for at least
15 days. Please provide the requested information as soon as
possible and set the bug status as REPORTED. Due to regular bug
tracker maintenance, if the bug is still in NEEDSINFO status with
no change in 30 days the bug will be closed as RESOLVED > WORKSFORME
due to lack of needed information.

For more information about our bug triaging procedures please read the
wiki located here:
https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

If you have already provided the requested information, please
mark the bug as REPORTED so that the KDE team knows that the bug is
ready to be confirmed.

Thank you for helping us make KDE software even better for everyone!
Comment 8 Bug Janitor Service 2023-01-14 05:11:38 UTC
This bug has been in NEEDSINFO status with no change for at least
30 days. The bug is now closed as RESOLVED > WORKSFORME
due to lack of needed information.

For more information about our bug triaging procedures please read the
wiki located here:
https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

Thank you for helping us make KDE software even better for everyone!