Activate the completion only when the canonical symbol has a valid name.

This commit is contained in:
Roberto Raggi
2009-10-26 13:45:01 +01:00
parent 3c0ca8c188
commit a2b5184123
2 changed files with 11 additions and 5 deletions

View File

@@ -762,10 +762,6 @@ void CPPEditor::findUsages()
void CPPEditor::renameUsages()
{
Core::EditorManager::instance()->showEditorInfoBar(QLatin1String("CppEditor.Rename"),
tr("This change cannot be undone."),
tr("Yes, I know what I am doing."),
this, SLOT(hideRenameNotification()));
renameUsagesNow();
}
@@ -777,7 +773,14 @@ void CPPEditor::hideRenameNotification()
void CPPEditor::renameUsagesNow()
{
if (Symbol *canonicalSymbol = markSymbols()) {
m_modelManager->renameUsages(canonicalSymbol);
if (canonicalSymbol->identifier() != 0) {
Core::EditorManager::instance()->showEditorInfoBar(QLatin1String("CppEditor.Rename"),
tr("This change cannot be undone."),
tr("Yes, I know what I am doing."),
this, SLOT(hideRenameNotification()));
m_modelManager->renameUsages(canonicalSymbol);
}
}
}