Fix #7161 by only refreshing when needed.#7162
Conversation
Check to see if the sortDirectoriesFirst has actually changed before refresh.
There was a problem hiding this comment.
Might want to align this =
|
@dangoor It looks good. I though that the "change" event would fire only if the value of the given preference changed. I think it should work like that, since that is what the name implies. Would it make sense if the event would also send the old and new preference values when you specify a preference? |
|
@TomMalbran At one point, the preferences system did work that way, but now with the ability to request prefs with a variety of contexts it's up to the subscriber to decide what to do when there's a possible change and how to best keep track of before/after values. The preference system can easily detect that there might have been a change for a given pref, but knowing for certain whether or not the value changed is not as clear. We could do it for the I had actually put an "important note" in the preferences system docs for this, though I know that's less ideal than an API that's as easy as possible. |
|
Ok. Keeping track of the preference isn't that hard anyway, and it only needs to be done for some. I was checking the code and sending the old and new pref, seems to be hard. Anyway, the fix looks good. |
|
OK, thanks for reviewing. I'll merge based on your review of the change. |
Fix #7161 by only refreshing when needed.
Fix for #7161
Check to see if the sortDirectoriesFirst has actually changed before refresh.
@TomMalbran want to take a look?