'-nosession' must not overwrite config.xml (Fix #3938)

When `-nosession` is given as a command line parameter the attribute
`isSnapshotMode` in `config.xml` is overwritten with `no` regardless of
its original value.

    <GUIConfig name="Backup" action="0" useCustumDir="no"
               dir="" isSnapshotMode="yes" snapshotBackupTiming="7000" />

Change this to keep the original value.

Fix #3938, close #5845
This commit is contained in:
Micha Wiedenmann 2019-06-27 13:36:59 +02:00 committed by Don HO
parent 9f1deb4823
commit b3a6638b93
No known key found for this signature in database
GPG Key ID: 6C429F1D8D84F46E

View File

@ -5662,7 +5662,7 @@ void NppParameters::createXmlTreeFromGUIParams()
GUIConfigElement->SetAttribute(TEXT("useCustumDir"), _nppGUI._useDir ? TEXT("yes") : TEXT("no"));
GUIConfigElement->SetAttribute(TEXT("dir"), _nppGUI._backupDir.c_str());
GUIConfigElement->SetAttribute(TEXT("isSnapshotMode"), _nppGUI.isSnapshotMode() ? TEXT("yes") : TEXT("no"));
GUIConfigElement->SetAttribute(TEXT("isSnapshotMode"), _nppGUI._isSnapshotMode ? TEXT("yes") : TEXT("no"));
GUIConfigElement->SetAttribute(TEXT("snapshotBackupTiming"), static_cast<int32_t>(_nppGUI._snapshotBackupTiming));
}