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) {
if (obj != 0 && getModelIndex(obj,0).isValid() ){
//set new values for the object
QVector< QVariant > values;
values.push_back( obj->name() );
values.push_back( obj->visible() );
values.push_back( obj->source() );
values.push_back( obj->target() );
for(int i=0; i < 4; i++)
setData( getModelIndex(obj,i), values[i], 0);
// //set new values for the object
// QVector< QVariant > values;
//
// values.push_back( obj->name() );
// values.push_back( obj->visible() );
// values.push_back( obj->source() );
// values.push_back( obj->target() );
//
// for(int i=0; i < 4; i++)
// setData( getModelIndex(obj,i), values[i], 0);
//
return;
}
}
......@@ -589,6 +589,8 @@ bool TreeModel::setData(const QModelIndex &index, const QVariant &value, int /*r
// <- Item is not a group
bool checked;
// Decide on column what to do with the value ( abort if anything goes wrong)
switch ( index.column() ) {
// Name :
......@@ -624,13 +626,9 @@ bool TreeModel::setData(const QModelIndex &index, const QVariant &value, int /*r
// source
case 2 :
if ( value.toInt() == Qt::Unchecked ) {
item->source(false);
}
checked = value.toBool();
if ( value.toInt() == Qt::Checked ) {
item->source(true);
}
item->source( checked );
updateSourceSelection( item->parent() );
......@@ -638,13 +636,10 @@ bool TreeModel::setData(const QModelIndex &index, const QVariant &value, int /*r
//target
case 3 :
if ( value.toInt() == Qt::Unchecked ) {
item->target(false);
}
if ( value.toInt() == Qt::Checked ) {
item->target(true);
}
checked = value.toBool();
item->target( checked );
updateTargetSelection( item->parent() );
......
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