[Kst] kst_threading_branch: kdeextragear-2/kst/kst

George Staikos staikos at kde.org
Fri Jan 16 04:35:04 CET 2004


CVS commit by staikos: 

add locking


  M +18 -0     filterlisteditor.ui.h   1.16.2.2


--- kdeextragear-2/kst/kst/filterlisteditor.ui.h  #1.16.2.1:1.16.2.2
@@ -23,7 +23,9 @@ void FilterListEditor::update()
     QString cur = _select->currentText();
     _select->clear();
+    KST::filterSetList.lock();
     for (KstFilterSetList::Iterator it = KST::filterSetList.begin(); it != KST::filterSetList.end(); ++it) {
         _select->insertItem((*it)->name());
     }
+    KST::filterSetList.unlock();
 
     if (!cur.isEmpty()) {
@@ -44,7 +46,9 @@ void FilterListEditor::update()
     
     _vectors->clear();
+    KST::vectorList.lock();
     for (KstVectorList::Iterator vit = KST::vectorList.begin(); vit != KST::vectorList.end(); ++vit) {
         new QCheckListItem(_vectors, (*vit)->tagName(), QCheckListItem::CheckBox);
     }
+    KST::vectorList.unlock();
  
     comboChanged();
@@ -55,5 +59,7 @@ void FilterListEditor::displayObject()
 {
 //    kdDebug() << "displayObject - currentSet=" << _currentSet << " item=" << _select->currentItem() << endl;
+    KST::filterSetList.lock();
     KstFilterSetPtr set = KST::filterSetList.find(_currentSet);
+    KST::filterSetList.unlock();
     if (set) {
         _applied->clear();
@@ -122,5 +128,7 @@ void FilterListEditor::moveRight()
                 KstScalar *s = new KstScalar;
                 fli->arguments.insert((*ivi)._name, s);
+                KST::scalarList.lock();
                 KST::scalarList.remove(s);
+                KST::scalarList.unlock();
             }
         }
@@ -131,5 +139,7 @@ void FilterListEditor::moveRight()
 void FilterListEditor::applyToVectors()
 {
+    KST::filterSetList.lock();
     KstFilterSetPtr set = KST::filterSetList.find(_currentSet);
+    KST::filterSetList.unlock();
     if (!set) {
         KMessageBox::error(this, i18n("Error applying filter set '%1' to selected vectors."), i18n("Kst"));
@@ -140,5 +150,7 @@ void FilterListEditor::applyToVectors()
         QCheckListItem *cli = static_cast<QCheckListItem*>(lvi);
         if (cli->isOn()) {
+            KST::vectorList.lock();
             KstVectorPtr v = *KST::vectorList.findTag(cli->text(0));
+            KST::vectorList.unlock();
             if (v) {
                 kdDebug() << "Creating a new filtered vector." << endl;
@@ -236,4 +248,5 @@ void FilterListEditor::filtersetModified
 void FilterListEditor::applyChanges()
 {
+    KST::filterSetList.lock();
     KstFilterSetPtr p = KST::filterSetList.find(_currentSet);
     if (!p.data()) {
@@ -248,4 +261,5 @@ void FilterListEditor::applyChanges()
         }
     }
+    KST::filterSetList.unlock();
 
     p->clear();
@@ -303,9 +317,13 @@ void FilterListEditor::editFilter()
                     KstScalarPtr s = new KstScalar;
                     item->arguments[i->text(0)] = s;
+                    KST::scalarList.lock();
                     KST::scalarList.remove(s);
+                    KST::scalarList.unlock();
                 }
                 item->arguments[i->text(0)]->setValue(x);
             } else {
+                KST::scalarList.lock();
                 KstScalarPtr s = *KST::scalarList.findTag(i->text(1));
+                KST::scalarList.unlock();
                 if (!s) {
                     s = new KstScalar(i->text(1));





More information about the Kst mailing list