summaryrefslogtreecommitdiffstats
path: root/mappingtreemodel.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'mappingtreemodel.cpp')
-rw-r--r--mappingtreemodel.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/mappingtreemodel.cpp b/mappingtreemodel.cpp
index 2dec7fa..3dabe16 100644
--- a/mappingtreemodel.cpp
+++ b/mappingtreemodel.cpp
@@ -128,6 +128,11 @@ bool MappingTreeModel::setData(const QModelIndex &index, const QVariant &value,
}
SmTreeItem *item = itemAt(index);
if(role == Qt::EditRole){
+ if(index.column() == Name){
+ if(value.toString().contains("/")){
+ return false;
+ }
+ }
mDb.transaction();
QSqlQuery *q = 0;
if(item == root()){
@@ -146,6 +151,9 @@ bool MappingTreeModel::setData(const QModelIndex &index, const QVariant &value,
mDb.rollback();
}
if(role == NameRole){
+ if(value.toString().contains("/")){
+ return false;
+ }
item->setData(Name, value);
}
if(role == IdRole){