Skip to content

Commit 94e0510

Browse files
committed
MapPartUndo: Ignore visibility
To avoid changes going unnoticed, always restore map parts fully visible. Reverts recent change.
1 parent 3b0b6b2 commit 94e0510

File tree

2 files changed

+3
-10
lines changed

2 files changed

+3
-10
lines changed

src/undo/map_part_undo.cpp

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2014-2021 Kai Pastor
2+
* Copyright 2014 Kai Pastor
33
*
44
* This file is part of OpenOrienteering.
55
*
@@ -38,7 +38,6 @@ namespace literal
3838
const QLatin1String remove("remove");
3939
const QLatin1String modify("modify");
4040
const QLatin1String name("name");
41-
const QLatin1String visibility("visibility");
4241
}
4342

4443

@@ -50,7 +49,6 @@ MapPartUndoStep::MapPartUndoStep(Map* map, MapPartChange change, const MapPart*
5049
, change(change)
5150
, index(map->findPartIndex(part))
5251
, name(part->getName())
53-
, visibility(part->getVisibility())
5452
{
5553
// nothing else
5654
}
@@ -60,7 +58,6 @@ MapPartUndoStep::MapPartUndoStep(Map* map, MapPartChange change, int index)
6058
, change(change)
6159
, index(index)
6260
, name(map->getPart(index)->getName())
63-
, visibility(map->getPart(index)->getVisibility())
6461
{
6562
// nothing else
6663
}
@@ -70,7 +67,6 @@ MapPartUndoStep::MapPartUndoStep(Map* map)
7067
, change(UndefinedChange)
7168
, index(0)
7269
, name()
73-
, visibility()
7470
{
7571
// nothing else
7672
}
@@ -95,7 +91,7 @@ UndoStep* MapPartUndoStep::undo()
9591
{
9692
case AddMapPart:
9793
Q_ASSERT(map->getNumParts()+1 > index);
98-
map->addPart(new MapPart(name, map, visibility), index);
94+
map->addPart(new MapPart(name, map), index);
9995
redo_step = new MapPartUndoStep(map, RemoveMapPart, index);
10096
break;
10197
case RemoveMapPart:
@@ -158,7 +154,6 @@ void MapPartUndoStep::saveImpl(QXmlStreamWriter &xml) const
158154
case AddMapPart:
159155
case ModifyMapPart:
160156
change_element.writeAttribute(literal::name, name);
161-
change_element.writeAttribute(literal::visibility, visibility);
162157
break;
163158
case RemoveMapPart:
164159
case UndefinedChange:
@@ -178,7 +173,6 @@ void MapPartUndoStep::loadImpl(QXmlStreamReader &xml, SymbolDictionary &)
178173
change = (MapPartChange)type;
179174
index = change_element.attribute<int>(literal::part);
180175
name = change_element.attribute<QString>(literal::name);
181-
visibility = change_element.hasAttribute(literal::visibility) ? change_element.attribute<int>(literal::visibility) : 100;
182176
}
183177
}
184178

src/undo/map_part_undo.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2014-2021 Kai Pastor
2+
* Copyright 2014 Kai Pastor
33
*
44
* This file is part of OpenOrienteering.
55
*
@@ -92,7 +92,6 @@ class MapPartUndoStep : public UndoStep
9292
int index;
9393

9494
QString name;
95-
int visibility;
9695
};
9796

9897

0 commit comments

Comments
 (0)