Browse Source

clear the [notebooks] section first before storing new one

Signed-off-by: Le Tan <[email protected]>
Le Tan 9 years ago
parent
commit
2bd3194af6
1 changed files with 5 additions and 0 deletions
  1. 5 0
      src/vconfigmanager.cpp

+ 5 - 0
src/vconfigmanager.cpp

@@ -76,6 +76,11 @@ void VConfigManager::readNotebookFromSettings()
 
 void VConfigManager::writeNotebookToSettings()
 {
+    // Clear it first
+    userSettings->beginGroup("notebooks");
+    userSettings->remove("");
+    userSettings->endGroup();
+
     userSettings->beginWriteArray("notebooks");
     for (int i = 0; i < notebooks.size(); ++i) {
         userSettings->setArrayIndex(i);