11-24-2022, 09:20 AM
I noticed in CORE 0.8.1 an unexpected behavior. When requesting a preference that has not yet been created:
I had expected success to be set to false and n to remain set to 3.
As a workaround, I did this:
Code:
int n = 3;
bool success = HDI_CORE_ILLUSTRATOR->preferences()->getIntPref("foo", "bar", n);
// success now equals true
// n now equals 0
I had expected success to be set to false and n to remain set to 3.
As a workaround, I did this:
Code:
std::string str;
HDI_CORE_ILLUSTRATOR->preferences()->getStringPref("foo", "bar", str);
if (str != "")
n = stoi(str);