mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-10 13:06:59 -04:00
Found the source of the growing style file bug (and fixed it)
git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@645 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
@@ -16,6 +16,7 @@
|
||||
#include <util/platform.hpp>
|
||||
#include <util/io/reader.hpp>
|
||||
#include <util/io/writer.hpp>
|
||||
#include <util/delayed_index_maps.hpp>
|
||||
#include <wx/filename.h>
|
||||
#include <wx/wfstream.h>
|
||||
#include <wx/stdpaths.h>
|
||||
@@ -218,7 +219,18 @@ IMPLEMENT_REFLECTION_NO_SCRIPT(Settings) {
|
||||
REFLECT(export_options);
|
||||
}
|
||||
|
||||
void Settings::clear() {
|
||||
recent_sets.clear();
|
||||
game_settings.clear();
|
||||
stylesheet_settings.clear();
|
||||
default_stylesheet_settings = StyleSheetSettings();
|
||||
export_options.clear();
|
||||
}
|
||||
|
||||
void Settings::read() {
|
||||
// clear current settings, otherwise we duplicate vector elements
|
||||
clear();
|
||||
// (re)load settings
|
||||
String filename = settingsFile();
|
||||
if (wxFileExists(filename)) {
|
||||
// settings file not existing is not an error
|
||||
|
||||
@@ -171,6 +171,8 @@ class Settings {
|
||||
private:
|
||||
/// Name of the settings file
|
||||
String settingsFile();
|
||||
/// Clear settings before reading them
|
||||
void clear();
|
||||
|
||||
DECLARE_REFLECTION();
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user