Ignore:
Timestamp:
Jul 12, 2017, 7:12:47 PM (8 years ago)
Author:
Frederik Heber <frederik.heber@…>
Branches:
Action_Thermostats, Adding_MD_integration_tests, Adding_StructOpt_integration_tests, AutomationFragmentation_failures, Candidate_v1.6.1, ChemicalSpaceEvaluator, Enhanced_StructuralOptimization, Enhanced_StructuralOptimization_continued, Exclude_Hydrogens_annealWithBondGraph, Fix_Verbose_Codepatterns, ForceAnnealing_with_BondGraph, ForceAnnealing_with_BondGraph_continued, ForceAnnealing_with_BondGraph_continued_betteresults, ForceAnnealing_with_BondGraph_contraction-expansion, Gui_displays_atomic_force_velocity, JobMarket_RobustOnKillsSegFaults, JobMarket_StableWorkerPool, PythonUI_with_named_parameters, Recreated_GuiChecks, StoppableMakroAction, TremoloParser_IncreasedPrecision
Children:
9a1e099
Parents:
4c6f0d
git-author:
Frederik Heber <frederik.heber@…> (07/12/17 14:34:42)
git-committer:
Frederik Heber <frederik.heber@…> (07/12/17 19:12:47)
Message:

Qt..Lists now take note of subjectKilled propery.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/UIElements/Views/Qt4/QtGeometryList.cpp

    r4c6f0d r3c9ac3  
    5454QtGeometryList::QtGeometryList(QWidget * _parent) :
    5555    QTreeWidget (_parent),
    56     Observer("QtGeometryList")
     56    Observer("QtGeometryList"),
     57    geometryregistry_enabled(false)
    5758{
    5859  setColumnCount(COLUMNCOUNT);
     
    7374        GeometryRegistry::getInstance().signOn(this, GeometryRegistry::GeometryInserted);
    7475        GeometryRegistry::getInstance().signOn(this, GeometryRegistry::GeometryRemoved);
     76        geometryregistry_enabled = true;
    7577
    7678        QCoreApplication::instance()->installEventFilter(this);
     
    7981QtGeometryList::~QtGeometryList()
    8082{
    81   GeometryRegistry::getInstance().signOff(this);
    82   GeometryRegistry::getInstance().signOff(this, GeometryRegistry::GeometryInserted);
    83   GeometryRegistry::getInstance().signOff(this, GeometryRegistry::GeometryRemoved);
     83  if (geometryregistry_enabled) {
     84    GeometryRegistry::getInstance().signOff(this);
     85    GeometryRegistry::getInstance().signOff(this, GeometryRegistry::GeometryInserted);
     86    GeometryRegistry::getInstance().signOff(this, GeometryRegistry::GeometryRemoved);
     87  }
     88}
     89
     90void QtGeometryList::subjectKilled(Observable *publisher)
     91{
     92  // as a new instance should always already be present ... just sign on
     93  if (static_cast<GeometryRegistry *>(publisher) == GeometryRegistry::getPointer()) {
     94    geometryregistry_enabled = false;
     95  }
    8496}
    8597
     
    133145    refill(NULL);*/
    134146  QTreeWidget::paintEvent(event);
    135 }
    136 
    137 void QtGeometryList::subjectKilled(Observable *publisher) {
    138147}
    139148
Note: See TracChangeset for help on using the changeset viewer.