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

List:       kde-commits
Subject:    branches/kdevelop/3.4/languages/cpp
From:       David Nolden <david.nolden.kde () art-master ! de>
Date:       2007-01-18 15:46:51
Message-ID: 1169135211.356470.14066.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 624975 by zwabel:

Do not increase the safety-counter in some unnecessary occassions. This removes some \
"KDevParseError::MaximumCountReached" errors showed in the navigation-menu when \
working with big projects.

 M  +1 -1      cppcodecompletion.cpp  
 M  +5 -0      safetycounter.h  
 M  +1 -1      simpletypefunction.cpp  
 M  +10 -3     simpletypenamespace.cpp  


--- branches/kdevelop/3.4/languages/cpp/cppcodecompletion.cpp #624974:624975
@@ -375,7 +375,7 @@
 	        QStringList wholeScope = ns->scope();
 	        wholeScope << ns->name();
 	        for( FileList::iterator it = files.begin(); it != files.end(); ++it ) {
-		        if( !safetyCounter ) break;
+		        //		        if( !safetyCounter ) break;
 		        NamespaceModel* ns = (*it).data();
 
 		        for( QStringList::iterator it2 = wholeScope.begin(); it2 != \
                wholeScope.end(); ++it2 ) {
--- branches/kdevelop/3.4/languages/cpp/safetycounter.h #624974:624975
@@ -33,6 +33,11 @@
     safetyCounter++;
     return *this;
   }
+
+  ///Returns whether the counter is ok, but without increasing it
+  bool ok() const {
+    return safetyCounter < maxSafetyCounter;
+  }
   
   operator bool() {
     safetyCounter++;
--- branches/kdevelop/3.4/languages/cpp/simpletypefunction.cpp #624974:624975
@@ -141,7 +141,7 @@
 
 void SimpleTypeFunctionInterface::appendNextFunction( SimpleType func ) {
   Debug d( "#fapp#" );
-  if ( !func || !safetyCounter || !d ) return;
+  if ( !func || !d ) return;
   if (( SimpleTypeImpl* ) func.get() == ( SimpleTypeImpl* ) this ) return;
   if ( m_nextFunction && m_nextFunction->asFunction() ) {
     m_nextFunction->asFunction()->appendNextFunction( func );
--- branches/kdevelop/3.4/languages/cpp/simpletypenamespace.cpp #624974:624975
@@ -17,6 +17,8 @@
 
 #include "safetycounter.h"
 
+//Whether additional output about imported and not imported namespaces should be \
printen +//#define IMPORT_DEBUG
 
 extern SafetyCounter safetyCounter;
 
@@ -243,9 +245,8 @@
 }
 
 void SimpleTypeNamespace::updateAliases( const IncludeFiles& files ) {
-  if ( !safetyCounter ) return;
   SlaveList tempList;
-  if ( m_activeSlaves.empty() ) return;
+  if ( m_activeSlaves.empty() || !safetyCounter.ok() ) return;
   while ( !m_activeSlaves.empty() ) {
     tempList.splice( tempList.begin(), m_activeSlaves, --m_activeSlaves.end() );
 
@@ -286,7 +287,7 @@
       updateAliases( files );
       break;
     } else {
-      dbg() << "took \"" << tempList.front().first.first.fullNameChain() << "\" from \
the slave-list" << endl; +      //      dbg() << "took \"" << \
tempList.front().first.first.fullNameChain() << "\" from the slave-list" << endl;  }
   }
   m_activeSlaves.splice( m_activeSlaves.end(), tempList );
@@ -346,12 +347,18 @@
   updateAliases( files );
   SlaveList ret;
   for ( SlaveList::const_iterator it = m_activeSlaves.begin(); it != \
m_activeSlaves.end(); ++it ) { +#ifdef IMPORT_DEBUG    
     ifVerbose( dbg() << "\"" << str() << "\": Checking whether \"" << \
(*it).first.first.fullNameChain() << "\" should be imported, current include-files: " \
<< files.print().c_str() << "\nNeeded include-files: " << \
(*it).first.second.print().c_str() << "\n"; ) +#endif
     if ( !(( *it ).first.second <= files ) ) {
+#ifdef IMPORT_DEBUG    
       ifVerbose( dbg() << "not imported." );
+#endif
       continue;
     }
+#ifdef IMPORT_DEBUG    
     ifVerbose( dbg() << "imported." << endl );
+#endif
     ret.push_back( *it );
   }
   return ret;


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

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