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

List:       kde-core-devel
Subject:    Re: Eloquens now on KDEREVIEW)
From:       Harald Sitter <sitter () kde ! org>
Date:       2022-06-22 13:10:30
Message-ID: CAEc+18G_18dTOqXrR2jgfC2yi2gL+W4uQKu7eAOQAKwzoc57cA () mail ! gmail ! com
[Download RAW message or body]

On Wed, Jun 22, 2022 at 12:07 AM Felipe Kinoshita <kinofhek@gmail.com> wrote:
>
> > Could you elaborate why your config.kcfg uses Ints for everything when
> > you clearly want booleans (e.g. `Config.code == 1 ? true : false`)
>
> The API expects ones and zeros for its params, I chose to convert them to
> booleans to make the API call easier to write and change.

Ah! I would suggest moving the conversion into the Controller then. As
far as kcfg, your Config object and your Settings.qml are concerned
they can be proper bools, it's only in the Controller that you have
the presentation requirement that bools must be 0/1. This saves you
the two-way conversion, in the Controller you only need to convert
bool=>int and the rest of the app can treat them as proper bools.

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

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