[Kst] kdeextragear-2/kst/kst
George Staikos
staikos at kde.org
Tue Jul 15 15:19:29 CEST 2003
CVS commit by staikos:
The final ref counting bugs that I could find.
M +10 -10 kstdatamanager_i.cpp 1.28
M +2 -2 kstdataobject.cpp 1.13
--- kdeextragear-2/kst/kst/kstdatamanager_i.cpp #1.27:1.28
@@ -90,6 +90,6 @@ class KstObjectItem : public QListViewIt
virtual int rtti() const { return _rtti; }
- const QString& vector() const { return _name; }
- KstRVectorPtr rvector() { return *kstObjectSubList<KstVector,KstRVector>(KST::vectorList).findTag(_name); }
+ const QString& tagName() const { return _name; }
+ //KstRVectorPtr rvector() { return *kstObjectSubList<KstVector,KstRVector>(KST::vectorList).findTag(_name); }
KstDataObjectPtr dataObject() { return *KST::dataObjectList.findTag(_name); }
@@ -146,9 +146,4 @@ void KstDataManagerI::update() {
DataView->clear();
- KstRVectorList rvl = kstObjectSubList<KstVector,KstRVector>(KST::vectorList);
- for (KstRVectorList::iterator it = rvl.begin(); it != rvl.end(); ++it) {
- new KstObjectItem(DataView, *it, this);
- }
-
for (KstDataObjectList::iterator it = KST::dataObjectList.begin();
it != KST::dataObjectList.end();
@@ -157,4 +152,9 @@ void KstDataManagerI::update() {
}
+ KstRVectorList rvl = kstObjectSubList<KstVector,KstRVector>(KST::vectorList);
+ for (KstRVectorList::iterator it = rvl.begin(); it != rvl.end(); ++it) {
+ new KstObjectItem(DataView, *it, this);
+ }
+
Edit->setEnabled(false);
Delete->setEnabled(false);
@@ -182,10 +182,10 @@ void KstDataManagerI::edit_I() {
void KstDataManagerI::delete_I() {
QListViewItem *qi = DataView->selectedItems().at(0);
- KstObjectItem* koi = static_cast<KstObjectItem*>(qi);
+ KstObjectItem *koi = static_cast<KstObjectItem*>(qi);
if (qi->rtti() == RTTI_OBJ_OBJECT) {
- doc->removeDataObject(koi->dataObject()->tagName());
+ doc->removeDataObject(koi->tagName());
} else if (qi->rtti() == RTTI_OBJ_DATA_VECTOR) {
- KST::vectorList.removeTag(koi->vector());
+ KST::vectorList.removeTag(koi->tagName());
doc->setModified();
doc->update();
--- kdeextragear-2/kst/kst/kstdataobject.cpp #1.12:1.13
@@ -90,5 +90,5 @@ int rc = 0;
for (KstVectorList::ConstIterator i = _outputVectors.begin(); i != _outputVectors.end(); ++i) {
if ((*i).data()) {
- rc += (*i)->getUsage();
+ rc += (*i)->getUsage() - 1;
}
}
@@ -96,5 +96,5 @@ int rc = 0;
for (KstScalarList::ConstIterator i = _outputScalars.begin(); i != _outputScalars.end(); ++i) {
if ((*i).data()) {
- rc += (*i)->getUsage();
+ rc += (*i)->getUsage() - 1;
}
}
More information about the Kst
mailing list