summaryrefslogtreecommitdiff
path: root/src/mapdata.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/mapdata.py')
-rw-r--r--src/mapdata.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/mapdata.py b/src/mapdata.py
index d4bc571..de00b10 100644
--- a/src/mapdata.py
+++ b/src/mapdata.py
@@ -343,9 +343,11 @@ class KPMap(object):
if fromIndex == toIndex:
return
if fromIndex < 0 or toIndex < 0:
- raise ValueError
+ return
if fromIndex >= len(self.layers) or toIndex > len(self.layers):
- raise ValueError
+ return
+ if fromIndex == toIndex-1:
+ return
self.layerModel.beginMoveRows(
QtCore.QModelIndex(), fromIndex, fromIndex,
@@ -363,7 +365,7 @@ class KPMap(object):
def removeLayer(self, layer):
if layer not in self.layers:
- raise ValueError
+ return
index = self.layers.index(layer)
self.layerModel.beginRemoveRows(QtCore.QModelIndex(), index, index)