Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
M
magicseteditor
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
MyCard
magicseteditor
Commits
8a499083
Commit
8a499083
authored
Aug 29, 2007
by
twanvl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Found the source of the growing style file bug (and fixed it)
parent
6dc63c2d
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
21 additions
and
0 deletions
+21
-0
src/data/settings.cpp
src/data/settings.cpp
+12
-0
src/data/settings.hpp
src/data/settings.hpp
+2
-0
src/util/delayed_index_maps.hpp
src/util/delayed_index_maps.hpp
+5
-0
src/util/index_map.hpp
src/util/index_map.hpp
+2
-0
No files found.
src/data/settings.cpp
View file @
8a499083
...
...
@@ -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
...
...
src/data/settings.hpp
View file @
8a499083
...
...
@@ -171,6 +171,8 @@ class Settings {
private:
/// Name of the settings file
String
settingsFile
();
/// Clear settings before reading them
void
clear
();
DECLARE_REFLECTION
();
};
...
...
src/util/delayed_index_maps.hpp
View file @
8a499083
...
...
@@ -32,6 +32,11 @@ IndexMap<Key,Value>& DelayedIndexMaps<Key,Value>::get(const String& name, const
return
item
->
read_data
;
}
template
<
typename
Key
,
typename
Value
>
void
DelayedIndexMaps
<
Key
,
Value
>::
clear
()
{
data
.
clear
();
}
// ----------------------------------------------------------------------------- : Reflection
// custom reflection : it's a template class
...
...
src/util/index_map.hpp
View file @
8a499083
...
...
@@ -148,6 +148,8 @@ class DelayedIndexMaps {
public:
/// Get the data for a specific name. Initialize the map with init_with (if it is not alread initialized)
IndexMap
<
Key
,
Value
>&
get
(
const
String
&
name
,
const
vector
<
Key
>&
init_with
);
/// Clear the delayed index map
void
clear
();
private:
map
<
String
,
intrusive_ptr
<
DelayedIndexMapsData
<
Key
,
Value
>
>
>
data
;
friend
class
Reader
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment