[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    KDE/kdevplatform/language/duchain
From:       David Nolden <david.nolden.kde () art-master ! de>
Date:       2009-03-01 0:00:13
Message-ID: 1235865613.962495.5464.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 933463 by zwabel:

Fix the "importer added multiple times" warning that was issued very often in the \
output


 M  +5 -3      ducontext.cpp  
 M  +2 -1      ducontext.h  


--- trunk/KDE/kdevplatform/language/duchain/ducontext.cpp #933462:933463
@@ -890,14 +890,14 @@
   return m_dynamicData->imports(origin, topContext(), 4);
 }
 
-void DUContext::addIndirectImport(const DUContext::Import& import) {
+bool DUContext::addIndirectImport(const DUContext::Import& import) {
   ENSURE_CAN_WRITE
   DUCHAIN_D_DYNAMIC(DUContext);
 
   for(unsigned int a = 0; a < d->m_importedContextsSize(); ++a) {
     if(d->m_importedContexts()[a] == import) {
       d->m_importedContextsList()[a].position = import.position;
-      return;
+      return true;
     }
   }
 
@@ -905,6 +905,7 @@
   ///Contexts added first, aka template-contexts, should stay in first place, so \
they are searched first.  
   d->m_importedContextsList().append(import);
+  return false;
 }
 
 void DUContext::addImportedParentContext( DUContext * context, const SimpleCursor& \
position, bool anonymous, bool /*temporary*/ ) @@ -917,7 +918,8 @@
   }
 
   Import import(context, position);
-  addIndirectImport(import);
+  if(addIndirectImport(import))
+    return;
 
   if( !anonymous && import.isBackwardMapped() ) {
     ENSURE_CAN_WRITE_(context)
--- trunk/KDE/kdevplatform/language/duchain/ducontext.h #933462:933463
@@ -411,8 +411,9 @@
    * Adds an imported context, which may be indirect.
    * @warning This is only allowed if this context is _NOT_ a top-context
    * @warning When using this mechanism, this context will not be registered as \
importer to the other one. +   * @return true if the import was already imported \
                before, else false.
    */
-  void addIndirectImport(const DUContext::Import& import);
+  bool addIndirectImport(const DUContext::Import& import);
 
   /**
    * Removes a child context.


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic