OSDN Git Service

C++ function signature: Add shortcut to marker tooltip.
authorChristian Kamm <christian.d.kamm@nokia.com>
Tue, 13 Sep 2011 09:07:37 +0000 (11:07 +0200)
committerChristian Kamm <christian.d.kamm@nokia.com>
Tue, 13 Sep 2011 12:33:44 +0000 (14:33 +0200)
Change-Id: Ied3268bb624df4201ca42beb76d20b9a638d5918
Reviewed-on: http://codereview.qt-project.org/4746
Reviewed-by: Leandro T. C. Melo <leandro.melo@nokia.com>
src/plugins/cppeditor/cppfunctiondecldeflink.cpp

index f8f4212..a992c62 100644 (file)
 #include <texteditor/tooltip/tooltip.h>
 #include <texteditor/tooltip/tipcontents.h>
 #include <utils/qtcassert.h>
+#include <utils/proxyaction.h>
+#include <coreplugin/actionmanager/actionmanager.h>
+#include <coreplugin/icore.h>
+#include <texteditor/texteditorconstants.h>
 
 #include <QtCore/QtConcurrentRun>
 
@@ -357,6 +361,12 @@ void FunctionDeclDefLink::showMarker(CPPEditorWidget *editor)
         message = tr("Apply changes to definition");
     else
         message = tr("Apply changes to declaration");
+
+    Core::ActionManager *actionManager = Core::ICore::instance()->actionManager();
+    Core::Command *quickfixCommand = actionManager->command(TextEditor::Constants::QUICKFIX_THIS);
+    if (quickfixCommand)
+        message = Utils::ProxyAction::stringWithAppendedShortcut(message, quickfixCommand->keySequence());
+
     marker.tooltip = message;
     marker.data = QVariant::fromValue(Marker());
     markers += marker;