fix settings comments placement

The comments for `scrollbarHideType` and for new pages are misplaced in
`settings.xml`, for two different reasons: comments arise as nodes
attached to the node which they comment on in the tree but are output
before the node in a textual representation. Therefore, the code
generating the tree can generate a node comment only after the node it
comments on (1st reason). The usage of macros hides this fact, so when
you circumvent the macros you have to assign the node variable manually,
or else the comment will be attached to the wrong node (2nd reason).
Fix both.
upstream-master
Michael J Gruber 5 years ago committed by Bryan Tan
parent a74e1efa3a
commit dabdb99376
  1. 13
      src/control/settings/Settings.cpp

@ -838,19 +838,18 @@ void Settings::save() {
WRITE_BOOL_PROP(disableScrollbarFadeout);
if (this->scrollbarHideType == SCROLLBAR_HIDE_BOTH) {
saveProperty("scrollbarHideType", "both", root);
xmlNode = saveProperty("scrollbarHideType", "both", root);
} else if (this->scrollbarHideType == SCROLLBAR_HIDE_HORIZONTAL) {
saveProperty("scrollbarHideType", "horizontal", root);
xmlNode = saveProperty("scrollbarHideType", "horizontal", root);
} else if (this->scrollbarHideType == SCROLLBAR_HIDE_VERTICAL) {
saveProperty("scrollbarHideType", "vertical", root);
xmlNode = saveProperty("scrollbarHideType", "vertical", root);
} else {
saveProperty("scrollbarHideType", "none", root);
xmlNode = saveProperty("scrollbarHideType", "none", root);
}
WRITE_BOOL_PROP(autoloadPdfXoj);
WRITE_COMMENT(
"Hides scroolbars in the main window, allowed values: \"none\", \"horizontal\", \"vertical\", \"both\"");
WRITE_BOOL_PROP(autoloadPdfXoj);
WRITE_STRING_PROP(defaultSaveName);
WRITE_BOOL_PROP(autosaveEnabled);
@ -887,8 +886,8 @@ void Settings::save() {
WRITE_UINT_PROP(preloadPagesAfter);
WRITE_BOOL_PROP(eagerPageCleanup);
WRITE_COMMENT("Config for new pages");
WRITE_STRING_PROP(pageTemplate);
WRITE_COMMENT("Config for new pages");
WRITE_STRING_PROP(sizeUnit);

Loading…
Cancel
Save