comparison data/model/Model.cpp @ 1754:8529763e2258 by-id

Tidy
author Chris Cannam
date Fri, 05 Jul 2019 16:55:27 +0100
parents 6d09d68165a4
children 83178b4bb698
comparison
equal deleted inserted replaced
1753:d954dfccd922 1754:8529763e2258
23 //#define DEBUG_COMPLETION 1 23 //#define DEBUG_COMPLETION 1
24 24
25 Model::~Model() 25 Model::~Model()
26 { 26 {
27 SVDEBUG << "Model::~Model: " << this << " with id " << getId() << endl; 27 SVDEBUG << "Model::~Model: " << this << " with id " << getId() << endl;
28 /*!!!
29 if (!m_aboutToDelete) {
30 SVDEBUG << "NOTE: Model(" << this << ", \""
31 << objectName() << "\", type uri <"
32 << m_typeUri << ">)::~Model(): Model deleted "
33 << "with no aboutToDelete notification"
34 << endl;
35 }
36 */
37 //!!! see notes in header - sort this out 28 //!!! see notes in header - sort this out
38 /* 29 /*
39 if (!m_alignmentModel.isNone()) { 30 if (!m_alignmentModel.isNone()) {
40 ModelById::release(m_alignmentModel); 31 ModelById::release(m_alignmentModel);
41 } 32 }
43 } 34 }
44 35
45 void 36 void
46 Model::setSourceModel(ModelId modelId) 37 Model::setSourceModel(ModelId modelId)
47 { 38 {
48 /*!!!
49 if (m_sourceModel) {
50 disconnect(m_sourceModel, SIGNAL(aboutToBeDeleted()),
51 this, SLOT(sourceModelAboutToBeDeleted()));
52 }
53 */
54
55 m_sourceModel = modelId; 39 m_sourceModel = modelId;
56 40
57 auto model = ModelById::get(m_sourceModel); 41 auto model = ModelById::get(m_sourceModel);
58 if (model) { 42 if (model) {
59 connect(model.get(), SIGNAL(alignmentCompletionChanged(ModelId)), 43 connect(model.get(), SIGNAL(alignmentCompletionChanged(ModelId)),
60 this, SIGNAL(alignmentCompletionChanged(ModelId))); 44 this, SIGNAL(alignmentCompletionChanged(ModelId)));
61 } 45 }
62
63
64 /*
65 if (m_sourceModel) {
66 connect(m_sourceModel, SIGNAL(alignmentCompletionChanged()),
67 this, SIGNAL(alignmentCompletionChanged()));
68 connect(m_sourceModel, SIGNAL(aboutToBeDeleted()),
69 this, SLOT(sourceModelAboutToBeDeleted()));
70 }
71 */
72 }
73 /*!!!
74 void
75 Model::aboutToDelete()
76 {
77 SVDEBUG << "Model(" << this << ", \""
78 << objectName() << "\", type name \""
79 << getTypeName() << "\", type uri <"
80 << m_typeUri << ">)::aboutToDelete()" << endl;
81
82 if (m_aboutToDelete) {
83 SVDEBUG << "WARNING: Model(" << this << ", \""
84 << objectName() << "\", type uri <"
85 << m_typeUri << ">)::aboutToDelete: "
86 << "aboutToDelete called more than once for the same model"
87 << endl;
88 }
89
90 emit aboutToBeDeleted();
91 m_aboutToDelete = true;
92 } 46 }
93 47
94 void
95 Model::sourceModelAboutToBeDeleted()
96 {
97 m_sourceModel = nullptr;
98 }
99 */
100 void 48 void
101 Model::setAlignment(ModelId alignmentModel) 49 Model::setAlignment(ModelId alignmentModel)
102 { 50 {
103 SVDEBUG << "Model(" << this << "): accepting alignment model " 51 SVDEBUG << "Model(" << this << "): accepting alignment model "
104 << alignmentModel << endl; 52 << alignmentModel << endl;