[Kst] extragear/graphics/kst/src/libkstapp
Eli Fidler
eli at staikos.net
Fri Feb 2 18:41:59 CET 2007
SVN commit 629408 by fidler:
fix locking bugs -- this should fix bugs 141052 and 141054
fix tag testing
M +9 -18 kstbasicdialog_i.cpp
--- trunk/extragear/graphics/kst/src/libkstapp/kstbasicdialog_i.cpp #629407:629408
@@ -293,24 +293,15 @@
Q_ASSERT(ptr); //should never happen...
ptr->writeLock();
- if (_tagName->text() != ptr->tagName() && KstData::self()->dataTagNameNotUnique(_tagName->text())) {
+ KstObjectTag newTag = KstObjectTag::fromString(_tagName->text());
+ if (newTag != ptr->tag() && KstData::self()->dataTagNameNotUnique(_tagName->text())) {
_tagName->setFocus();
ptr->unlock();
return false;
}
- ptr->setTagName(KstObjectTag::fromString(_tagName->text()));
+ ptr->setTagName(newTag);
- // Must unlock before clear()
- for (KstVectorMap::Iterator i = ptr->inputVectors().begin(); i != ptr->inputVectors().end(); ++i) {
- (*i)->unlock();
- }
- for (KstScalarMap::Iterator i = ptr->inputScalars().begin(); i != ptr->inputScalars().end(); ++i) {
- (*i)->unlock();
- }
- for (KstStringMap::Iterator i = ptr->inputStrings().begin(); i != ptr->inputStrings().end(); ++i) {
- (*i)->unlock();
- }
ptr->inputVectors().clear();
ptr->inputScalars().clear();
ptr->inputStrings().clear();
@@ -352,7 +343,7 @@
bool KstBasicDialogI::editSingleObject(KstBasicPluginPtr ptr) {
KST::vectorList.lock().readLock();
- KST::scalarList.lock().readLock();
+ KST::scalarList.lock().writeLock();
KST::stringList.lock().readLock();
{ // leave this scope here to destroy the iterators
@@ -369,6 +360,7 @@
}
}
}
+ KST::vectorList.lock().unlock();
//input scalars...
KstScalarList::Iterator s;
@@ -384,14 +376,15 @@
bool ok;
double val = w->_scalar->currentText().toDouble(&ok);
if (ok) {
- ptr->setInputScalar(*isI, new KstScalar(KstObjectTag::fromString(w->_scalar->currentText()),
- 0L, val, true, false, false)); // FIXME: should this be a global-context scalar?
+ KstScalarPtr sp = new KstScalar(KstObjectTag::fromString(w->_scalar->currentText()), 0L, val, true, false, false); // FIXME: should this be a global-context scalar?
+ ptr->setInputScalar(*isI, sp);
} else {
//deal with error...
}
}
}
}
+ KST::scalarList.lock().unlock();
//input strings...
KstStringList::Iterator str;
@@ -405,12 +398,10 @@
}
}
}
+ KST::stringList.lock().unlock();
}
- KST::stringList.lock().unlock();
- KST::scalarList.lock().unlock();
- KST::vectorList.lock().unlock();
return true;
}
More information about the Kst
mailing list