Mercurial > hg > svcore
comparison data/model/Model.cpp @ 1506:a250a54c11cc
Merge from branch avoid-pointer-keys
author | Chris Cannam |
---|---|
date | Tue, 04 Sep 2018 11:31:35 +0100 |
parents | 9d37c8cf9686 |
children | d3814e07b8aa |
comparison
equal
deleted
inserted
replaced
1505:d7fdc77252c6 | 1506:a250a54c11cc |
---|---|
38 m_alignment->aboutToDelete(); | 38 m_alignment->aboutToDelete(); |
39 delete m_alignment; | 39 delete m_alignment; |
40 } | 40 } |
41 } | 41 } |
42 | 42 |
43 int | |
44 Model::getNextId() | |
45 { | |
46 static int nextId = 0; | |
47 static QMutex mutex; | |
48 QMutexLocker locker(&mutex); | |
49 int i = nextId; | |
50 if (nextId == INT_MAX) { | |
51 nextId = INT_MIN; | |
52 } | |
53 ++nextId; | |
54 return i; | |
55 } | |
56 | |
43 void | 57 void |
44 Model::setSourceModel(Model *model) | 58 Model::setSourceModel(Model *model) |
45 { | 59 { |
46 if (m_sourceModel) { | 60 if (m_sourceModel) { |
47 disconnect(m_sourceModel, SIGNAL(aboutToBeDeleted()), | 61 disconnect(m_sourceModel, SIGNAL(aboutToBeDeleted()), |