Commit 98a734f4 authored by Dirk Wilden's avatar Dirk Wilden
Browse files

dont react on every updatedObject

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@5103 383ad7c9-94d9-4d36-a494-682f7c89f535
parent 61c6e0a9
...@@ -354,17 +354,17 @@ void TreeModel::updatedObject(int _id) { ...@@ -354,17 +354,17 @@ void TreeModel::updatedObject(int _id) {
if (obj != 0 && getModelIndex(obj,0).isValid() ){ if (obj != 0 && getModelIndex(obj,0).isValid() ){
//set new values for the object // //set new values for the object
QVector< QVariant > values; // QVector< QVariant > values;
//
values.push_back( obj->name() ); // values.push_back( obj->name() );
values.push_back( obj->visible() ); // values.push_back( obj->visible() );
values.push_back( obj->source() ); // values.push_back( obj->source() );
values.push_back( obj->target() ); // values.push_back( obj->target() );
//
for(int i=0; i < 4; i++) // for(int i=0; i < 4; i++)
setData( getModelIndex(obj,i), values[i], 0); // setData( getModelIndex(obj,i), values[i], 0);
//
return; return;
} }
} }
...@@ -588,7 +588,9 @@ bool TreeModel::setData(const QModelIndex &index, const QVariant &value, int /*r ...@@ -588,7 +588,9 @@ bool TreeModel::setData(const QModelIndex &index, const QVariant &value, int /*r
} }
// <- Item is not a group // <- Item is not a group
bool checked;
// Decide on column what to do with the value ( abort if anything goes wrong) // Decide on column what to do with the value ( abort if anything goes wrong)
switch ( index.column() ) { switch ( index.column() ) {
// Name : // Name :
...@@ -624,30 +626,23 @@ bool TreeModel::setData(const QModelIndex &index, const QVariant &value, int /*r ...@@ -624,30 +626,23 @@ bool TreeModel::setData(const QModelIndex &index, const QVariant &value, int /*r
// source // source
case 2 : case 2 :
if ( value.toInt() == Qt::Unchecked ) { checked = value.toBool();
item->source(false);
} item->source( checked );
if ( value.toInt() == Qt::Checked ) {
item->source(true);
}
updateSourceSelection( item->parent() ); updateSourceSelection( item->parent() );
break; break;
//target //target
case 3 : case 3 :
if ( value.toInt() == Qt::Unchecked ) {
item->target(false); checked = value.toBool();
}
item->target( checked );
if ( value.toInt() == Qt::Checked ) {
item->target(true);
}
updateTargetSelection( item->parent() ); updateTargetSelection( item->parent() );
break; break;
default: default:
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment