summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTreeki <treeki@gmail.com>2012-08-13 02:12:01 +0200
committerTreeki <treeki@gmail.com>2012-08-13 02:12:01 +0200
commit7606562f289ab0488892ca11c41137a8ba207ce5 (patch)
tree8bbb571d2dad5762b2458fc0f4cf4f3740bc41fb
parent86b4b22662426cc0127620de1e6451f1a2e1da79 (diff)
downloadLayoutStudio-7606562f289ab0488892ca11c41137a8ba207ce5.tar.gz
LayoutStudio-7606562f289ab0488892ca11c41137a8ba207ce5.zip
fixed segfault when you try to move panes to the top level(invalid)...
-rw-r--r--lsscenemodel.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/lsscenemodel.cpp b/lsscenemodel.cpp
index f5c4ba3..acb059c 100644
--- a/lsscenemodel.cpp
+++ b/lsscenemodel.cpp
@@ -110,6 +110,11 @@ bool LSSceneModel::insertRows(int row, int count, const QModelIndex &parent) {
return false;
}
+ if (!parent.isValid()) {
+ qWarning("can't move stuff to the top level");
+ return false;
+ }
+
m_movingPaneParent = new QPersistentModelIndex(parent);
m_movingPaneRow = row;
m_movingPaneCount = count;