Skip to content

fix reading wrong integer type from config

KConfig uses the default value to derive the type of the setting. This forces KConfig to return the correct integer type by casting the default to KIO::filesize_t instead of using plain 0, which is probably just an int. KConfig interpreting a value to big for an int or uint as such seems to be the cause of the following issue.

When MaximumRemoteSize was set to 4096 MiB or more, previews of remote files were not being shown, since dolphin believed the limit to be 0 when it was set to 4096 MiB.

before:

Setting 4095 MiB / 4293918720 Byte was read as 18446744073708503040 Bytes Setting 4096 MiB / 4294967296 Byte was read as 0 Bytes Setting 4097 MiB / 4296015872 Byte was read as 1048576 Bytes

I'm not sure which kind of combination of overflowing and/or misinterpreting chain would produce these, Reading a qulonglong as int, then storing it into a qulonglong again reproduces the weird values I got: https://invent.kde.org/-/snippets/2138

But indicating the value type we actually want helps. Values are now read / interpreted as expected (4294967296 as 4294967296, not 0)

BUG: 452048

Edited by Franz Baumgärtner

Merge request reports