Use the new InsertionPointLocator for declarations.

Still need to change it to use RefactoringChanges, and to do better definition
generation.
This commit is contained in:
Erik Verbruggen
2010-07-27 17:02:12 +02:00
parent b6f42dc7b3
commit aec36eec7c
2 changed files with 40 additions and 45 deletions

View File

@@ -57,7 +57,7 @@ static QString generate(InsertionPointLocator::AccessSpec xsSpec)
return QLatin1String("protected slots:\n");
case InsertionPointLocator::PrivateSlot:
return QLatin1String("private slot:\n");
return QLatin1String("private slots:\n");
case InsertionPointLocator::Signals:
return QLatin1String("signals:\n");
@@ -158,8 +158,8 @@ protected:
}
// try to find a fitting access spec to insert in front of:
AccessRange best = ranges.first();
for (int i = ranges.size() - 1; i > 0; --i) {
AccessRange best = ranges.last();
for (int i = ranges.size() - 2; i > 0; --i) {
const AccessRange &range = ranges.at(i);
if (distance(range.xsSpec, xsSpec) < distance(best.xsSpec, xsSpec))
best = range;