~ubuntu-branches/ubuntu/quantal/kdevplatform/quantal-proposed

« back to all changes in this revision

Viewing changes to language/duchain/declaration.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Alessandro Ghersi
  • Date: 2010-10-24 00:06:18 UTC
  • mfrom: (0.3.8 upstream)
  • Revision ID: james.westby@ubuntu.com-20101024000618-7otebin77mfcmt3b
Tags: 1.1.0-0ubuntu1
* New upstream release
  - Bump build-dependencies
  - Build against libboost-serialization1.42-dev
  - Update kdevplatform1-libs.install
  - Update kdevplatform-dev.install

Show diffs side-by-side

added added

removed removed

Lines of Context:
55
55
{
56
56
 
57
57
///@todo Use reference counting
58
 
Repositories::StringRepository commentRepository("Comment Repository");
 
58
static Repositories::StringRepository& commentRepository() {
 
59
    static Repositories::StringRepository commentRepositoryObject("Comment Repository");
 
60
    return commentRepositoryObject;
 
61
}
59
62
 
60
63
REGISTER_DUCHAIN_ITEM(Declaration);
61
64
 
194
197
  if(!d->m_comment)
195
198
    return 0;
196
199
  else
197
 
    return Repositories::arrayFromItem(commentRepository.itemFromIndex(d->m_comment));
 
200
    return Repositories::arrayFromItem(commentRepository().itemFromIndex(d->m_comment));
198
201
}
199
202
 
200
203
void Declaration::setComment(const QByteArray& str) {
202
205
  if(str.isEmpty())
203
206
    d->m_comment = 0;
204
207
  else
205
 
    d->m_comment = commentRepository.index(Repositories::StringRepositoryItemRequest(str, IndexedString::hashString(str, str.length()), str.length()));
 
208
    d->m_comment = commentRepository().index(Repositories::StringRepositoryItemRequest(str, IndexedString::hashString(str, str.length()), str.length()));
206
209
}
207
210
 
208
211
void Declaration::setComment(const QString& str) {