#129 Shouldnt rewrt db if only chg is treestatus & its ignored


PWS 3.12 is rewriting the database when the only thing I've done is change the "tree status". This is annoying behavior because:

1) I am 'sharing this file with myself' using Subversion, and this behavior causes spurious "file is changed" events (and obviously there is no way to diff this file-type to see whether the user-data in the file has changed, vs. metadata such as this).

2) it is completely unnecessary because I have selected the option Manage, Options, Display, Initial Tree View=Fully collapsed, thus I am in effect saying "I don't care about the previous Tree View", so there is no motivation to write this metadata into the file because it will be ignored on the next startup anyway.

So, my request is to modify DboxMain::OnOK(). Within the statement:

if (autoSave && !m_core.IsReadOnly() &&
(m_bTSUpdated || m_core.WasDisplayStatusChanged()) &&
m_core.GetNumEntries() > 0)

the subexpression


would become

((PWSprefs::AsPerLastSave == GetPref(PWSprefs::TreeDisplayStatusAtOpen)) && m_core.WasDisplayStatusChanged())

This way, the db file is only rewritten if there is a change in the metadata AND the metadata is actually going to be used when the file is next opened.

I would build and test this myself except I have MSVStudio 2003 installed and cannot risk installing a newer version.

TIA, Kevin


Log in to post a comment.