Commit a2b51841 authored by Roberto Raggi's avatar Roberto Raggi

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

parent 3c0ca8c1
...@@ -762,10 +762,6 @@ void CPPEditor::findUsages() ...@@ -762,10 +762,6 @@ void CPPEditor::findUsages()
void CPPEditor::renameUsages() 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(); renameUsagesNow();
} }
...@@ -777,7 +773,14 @@ void CPPEditor::hideRenameNotification() ...@@ -777,7 +773,14 @@ void CPPEditor::hideRenameNotification()
void CPPEditor::renameUsagesNow() void CPPEditor::renameUsagesNow()
{ {
if (Symbol *canonicalSymbol = markSymbols()) { 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);
}
} }
} }
......
...@@ -656,6 +656,9 @@ void CppFindReferences::renameUsages(Symbol *symbol) ...@@ -656,6 +656,9 @@ void CppFindReferences::renameUsages(Symbol *symbol)
void CppFindReferences::findAll_helper(Symbol *symbol) void CppFindReferences::findAll_helper(Symbol *symbol)
{ {
if (! (symbol && symbol->identifier()))
return;
_resultWindow->popup(true); _resultWindow->popup(true);
const Snapshot snapshot = _modelManager->snapshot(); const Snapshot snapshot = _modelManager->snapshot();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment