[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-02-11 19:02:29
Message-ID: 1171220549.918015.28822.nullmailer () svn ! kde ! org
[Download RAW message or body]
SVN commit 632616 by zwabel:
The code-model updating-patch introduced a new regression: Classes forward-declared \
in one file and declared in another should group those files together so they are \
always parsed together(because parsing one file adds items to the code-model of the \
other file). That grouping was lost when updating, so with each update a class of the \
same name was added to the parent-class in the other file. This patch fixes that \
problem, by correctly grouping the files together when updating.
M +1 -0 cppsupportpart.cpp
M +11 -1 store_walker.cpp
M +3 -0 store_walker.h
--- branches/kdevelop/3.4/languages/cpp/cppsupportpart.cpp #632615:632616
@@ -2423,6 +2423,7 @@
for( QMap<QString, FileDom>::const_iterator it = newFiles.begin(); it != \
newFiles.end(); ++it ) { FileDom oldFile = codeModel()->fileByName( it.key() );
oldFile->update( *it );
+ codeModel()->mergeGroups( oldFile->groupId(), (*it)->groupId() ); ///Merge \
parsing-groups together }
} else {
///Remove the current files and replace them with the new ones
--- branches/kdevelop/3.4/languages/cpp/store_walker.cpp #632615:632616
@@ -469,6 +469,16 @@
}
}
+int StoreWalker::mergeGroups( int g1, int g2 ) {
+ int ng = m_store->mergeGroups( g1, g2 );
+ for( QMap<QString, FileDom>::iterator it = m_overrides.begin(); it != \
m_overrides.end(); ++it ) { + int g =(*it)->groupId();
+ if( g == g1 || g == g2 )
+ (*it)->setGroupId( ng );
+ }
+ return ng;
+}
+
void StoreWalker::parseClassSpecifier( ClassSpecifierAST* ast )
{
int startLine, startColumn;
@@ -533,7 +543,7 @@
///since we are creating a link between both files, put them into the same \
parsing-group FileDom dm = embedderClass->file();
if( dm ) {
- m_file->setGroupId( m_store->mergeGroups( dm->groupId(), m_file->groupId() ) );
+ m_file->setGroupId( mergeGroups( dm->groupId(), m_file->groupId() ) );
}else{
kdDebug() << "file " << embedderClass->fileName() << " missing in store \n";
}
--- branches/kdevelop/3.4/languages/cpp/store_walker.h #632615:632616
@@ -90,6 +90,9 @@
return m_comments.front();
}
}
+
+ //Own implementation that also merges the groups of the overrides
+ int mergeGroups( int g1, int g2 );
public:
void pushComment( QString comm ) {
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic