It is currently April 20th, 2024, 9:55 am

[FIXED] Variables files: Variables with an empty value will not be preserved

Report bugs with the Rainmeter application and suggest features.
User avatar
raiguard
Posts: 660
Joined: June 25th, 2015, 7:02 pm
Location: The Sky, USA

[FIXED] Variables files: Variables with an empty value will not be preserved

Post by raiguard »

While trying to fix some issues related to using the 'Variables files' functionality in my suite, I discovered a bug in the functionality itself: If a variable is blank, like manualHideDisks=, then that value will always be overwritten with the blank, rather than preserving what it might have been set to before the update.

So if the value was set to manualHideDisks=D E, then the user installs a new version that has manualHideDisks= or manualHideDisks="", it will always overwrite the value with the blank, rather than keeping it as manualHideDisks=D E.

I hope that this is an issue that can be fixed. I can redesign the setting to not use a blank value, but it would be very painful and difficult.

To make it absolutely clear, here is a more filled-out example.

Current settings file:

Code: Select all

[Variables]
manualHideDisks=D E
foo=The fox says OWWWWWWW
New settings file:

Code: Select all

[Variables]
manualHideDisks=
foo=bar
Resulting settings file:

Code: Select all

[Variables]
manualHideDisks=
foo=The fox says OWWWWWWW
Last edited by raiguard on July 3rd, 2020, 10:11 pm, edited 1 time in total.
”We are pretty sure that r2922 resolves the regression in resolution caused by a reversion to a revision.” - jsmorley, 2017
User avatar
jsmorley
Developer
Posts: 22629
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: [BUG] Variables files: Variables with an empty value will not be preserved

Post by jsmorley »

A variable with a blank value is perfectly valid.
User avatar
raiguard
Posts: 660
Joined: June 25th, 2015, 7:02 pm
Location: The Sky, USA

Re: [BUG] Variables files: Variables with an empty value will not be preserved

Post by raiguard »

Yes, but if the user had changed it to a non-blank value, then the variables files function will still overwrite it with the blank upon updating.
”We are pretty sure that r2922 resolves the regression in resolution caused by a reversion to a revision.” - jsmorley, 2017
User avatar
jsmorley
Developer
Posts: 22629
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: [BUG] Variables files: Variables with an empty value will not be preserved

Post by jsmorley »

raiguard wrote: November 4th, 2018, 11:54 pm Yes, but if the user had changed it to a non-blank value, then the variables files function will still overwrite it with the blank upon updating.
Well, if you replace Bob with Jim or Bob with a blank, they are both a perfectly valid change.
User avatar
jsmorley
Developer
Posts: 22629
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: [BUG] Variables files: Variables with an empty value will not be preserved

Post by jsmorley »

At the end of the day, the "Variables files" functionality in the Advance tab of the .rmskin creator is a binary. If you specify a .inc file, it won't be replaced, so changes the user makes will be preserved. It's the entire file, not "replace this, but not that".
User avatar
raiguard
Posts: 660
Joined: June 25th, 2015, 7:02 pm
Location: The Sky, USA

Re: [BUG] Variables files: Variables with an empty value will not be preserved

Post by raiguard »

Sorry, I must not be explaining my issue properly. The reason I discovered this is because a user of my suite complained that his 'manually hidden disks' setting reset upon updating. Click here to view our conversation.

If you want to see it for yourself, download my suite, then go into disks meter's settings skin and hide some disks, and change some other options so it's obviously different from the default. Then go ahead and reinstall that same version again. Theoretically, it should preserve all of your settings. You will find that it preserves everything EXCEPT for which disks you told it to hide.

I'm saying that if the new value is blank, then the system will not overwrite it with the previously set value, instead leaving it blank.

EDIT: Updated explanation to make more sense.
Last edited by raiguard on November 5th, 2018, 12:04 am, edited 2 times in total.
”We are pretty sure that r2922 resolves the regression in resolution caused by a reversion to a revision.” - jsmorley, 2017
User avatar
jsmorley
Developer
Posts: 22629
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: [BUG] Variables files: Variables with an empty value will not be preserved

Post by jsmorley »

If you want to add new variables, but keep changes the user has made to existing variables, you need a second/new .inc file.
User avatar
jsmorley
Developer
Posts: 22629
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: [BUG] Variables files: Variables with an empty value will not be preserved

Post by jsmorley »

This may be a bug, I'm not sure. I will ask brian to take a look at it, but I'm not sure when he will be able to get to it.
User avatar
raiguard
Posts: 660
Joined: June 25th, 2015, 7:02 pm
Location: The Sky, USA

Re: [BUG] Variables files: Variables with an empty value will not be preserved

Post by raiguard »

Ok, fine with me. In the meantime I'll just have to change how it works to avoid blank values. Thanks for your time. :thumbup:
”We are pretty sure that r2922 resolves the regression in resolution caused by a reversion to a revision.” - jsmorley, 2017
User avatar
raiguard
Posts: 660
Joined: June 25th, 2015, 7:02 pm
Location: The Sky, USA

Re: [BUG] Variables files: Variables with an empty value will not be preserved

Post by raiguard »

Here's a very simple test skin that can be used to test it. The manualHideDisks option will always be reset to blank upon reinstalling, but the other values will be preserved.
You do not have the required permissions to view the files attached to this post.
”We are pretty sure that r2922 resolves the regression in resolution caused by a reversion to a revision.” - jsmorley, 2017