forked from qt-creator/qt-creator
GlslEditor: Some editor creation related cleanup
Use a BaseEditorFactory derived class, move some code around. Change-Id: Id560a215102016cdbe21809f97be8fc190ed5cf5 Reviewed-by: Christian Stenger <christian.stenger@digia.com>
This commit is contained in:
@@ -29,6 +29,7 @@
|
||||
|
||||
#include "glslhoverhandler.h"
|
||||
#include "glsleditor.h"
|
||||
#include "glsleditorconstants.h"
|
||||
|
||||
#include <coreplugin/editormanager/ieditor.h>
|
||||
#include <coreplugin/editormanager/editormanager.h>
|
||||
@@ -36,8 +37,6 @@
|
||||
#include <extensionsystem/pluginmanager.h>
|
||||
#include <texteditor/basetexteditor.h>
|
||||
|
||||
#include <QTextCursor>
|
||||
|
||||
using namespace Core;
|
||||
|
||||
namespace GlslEditor {
|
||||
@@ -51,15 +50,13 @@ GlslHoverHandler::~GlslHoverHandler()
|
||||
|
||||
bool GlslHoverHandler::acceptEditor(IEditor *editor)
|
||||
{
|
||||
return qobject_cast<GlslEditor *>(editor) != 0;
|
||||
return editor->context().contains(Constants::C_GLSLEDITOR_ID);
|
||||
}
|
||||
|
||||
void GlslHoverHandler::identifyMatch(TextEditor::BaseTextEditor *editor, int pos)
|
||||
{
|
||||
if (GlslEditorWidget *glslEditor = qobject_cast<GlslEditorWidget *>(editor->widget())) {
|
||||
if (! glslEditor->extraSelectionTooltip(pos).isEmpty())
|
||||
setToolTip(glslEditor->extraSelectionTooltip(pos));
|
||||
}
|
||||
if (!editor->editorWidget()->extraSelectionTooltip(pos).isEmpty())
|
||||
setToolTip(editor->editorWidget()->extraSelectionTooltip(pos));
|
||||
}
|
||||
|
||||
void GlslHoverHandler::decorateToolTip()
|
||||
|
||||
Reference in New Issue
Block a user