forked from qt-creator/qt-creator
Utils: Turn the names of Constants::GLSL_* conformant
The names in mimeconstants.h usually end with "_MIMETYPE" Change-Id: I593383f17519ff1ad77caf419210d33761748f38 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
@@ -32,10 +32,10 @@ const char CPP_SOURCE_MIMETYPE[] = "text/x-c++src";
|
|||||||
const char CUDA_SOURCE_MIMETYPE[] = "text/vnd.nvidia.cuda.csrc";
|
const char CUDA_SOURCE_MIMETYPE[] = "text/vnd.nvidia.cuda.csrc";
|
||||||
const char C_HEADER_MIMETYPE[] = "text/x-chdr";
|
const char C_HEADER_MIMETYPE[] = "text/x-chdr";
|
||||||
const char C_SOURCE_MIMETYPE[] = "text/x-csrc";
|
const char C_SOURCE_MIMETYPE[] = "text/x-csrc";
|
||||||
const char GLSL_MIMETYPE_FRAG[] = "text/x-glsl-frag";
|
const char GLSL_FRAG_MIMETYPE[] = "text/x-glsl-frag";
|
||||||
const char GLSL_MIMETYPE_FRAG_ES[] = "text/x-glsl-es-frag";
|
const char GLSL_ES_FRAG_MIMETYPE[] = "text/x-glsl-es-frag";
|
||||||
const char GLSL_MIMETYPE_VERT[] = "text/x-glsl-vert";
|
const char GLSL_VERT_MIMETYPE[] = "text/x-glsl-vert";
|
||||||
const char GLSL_MIMETYPE_VERT_ES[] = "text/x-glsl-es-vert";
|
const char GLSL_ES_VERT_MIMETYPE[] = "text/x-glsl-es-vert";
|
||||||
const char JAVA_MIMETYPE[] = "text/x-java";
|
const char JAVA_MIMETYPE[] = "text/x-java";
|
||||||
const char LINGUIST_MIMETYPE[] = "text/vnd.qt.linguist";
|
const char LINGUIST_MIMETYPE[] = "text/vnd.qt.linguist";
|
||||||
const char MAKEFILE_MIMETYPE[] = "text/x-makefile";
|
const char MAKEFILE_MIMETYPE[] = "text/x-makefile";
|
||||||
|
@@ -59,10 +59,10 @@ Protocol::ContentType Protocol::contentType(const QString &mt)
|
|||||||
if (mt == QLatin1String(C_SOURCE_MIMETYPE)
|
if (mt == QLatin1String(C_SOURCE_MIMETYPE)
|
||||||
|| mt == QLatin1String(C_HEADER_MIMETYPE)
|
|| mt == QLatin1String(C_HEADER_MIMETYPE)
|
||||||
|| mt == QLatin1String(GLSL_MIMETYPE)
|
|| mt == QLatin1String(GLSL_MIMETYPE)
|
||||||
|| mt == QLatin1String(GLSL_MIMETYPE_VERT)
|
|| mt == QLatin1String(GLSL_VERT_MIMETYPE)
|
||||||
|| mt == QLatin1String(GLSL_MIMETYPE_FRAG)
|
|| mt == QLatin1String(GLSL_FRAG_MIMETYPE)
|
||||||
|| mt == QLatin1String(GLSL_MIMETYPE_VERT_ES)
|
|| mt == QLatin1String(GLSL_ES_VERT_MIMETYPE)
|
||||||
|| mt == QLatin1String(GLSL_MIMETYPE_FRAG_ES))
|
|| mt == QLatin1String(GLSL_ES_FRAG_MIMETYPE))
|
||||||
return C;
|
return C;
|
||||||
if (mt == QLatin1String(CPP_SOURCE_MIMETYPE)
|
if (mt == QLatin1String(CPP_SOURCE_MIMETYPE)
|
||||||
|| mt == QLatin1String(CPP_HEADER_MIMETYPE)
|
|| mt == QLatin1String(CPP_HEADER_MIMETYPE)
|
||||||
|
@@ -366,10 +366,10 @@ GlslEditorFactory::GlslEditorFactory()
|
|||||||
setId(Constants::C_GLSLEDITOR_ID);
|
setId(Constants::C_GLSLEDITOR_ID);
|
||||||
setDisplayName(::Core::Tr::tr(Constants::C_GLSLEDITOR_DISPLAY_NAME));
|
setDisplayName(::Core::Tr::tr(Constants::C_GLSLEDITOR_DISPLAY_NAME));
|
||||||
addMimeType(Utils::Constants::GLSL_MIMETYPE);
|
addMimeType(Utils::Constants::GLSL_MIMETYPE);
|
||||||
addMimeType(Utils::Constants::GLSL_MIMETYPE_VERT);
|
addMimeType(Utils::Constants::GLSL_VERT_MIMETYPE);
|
||||||
addMimeType(Utils::Constants::GLSL_MIMETYPE_FRAG);
|
addMimeType(Utils::Constants::GLSL_FRAG_MIMETYPE);
|
||||||
addMimeType(Utils::Constants::GLSL_MIMETYPE_VERT_ES);
|
addMimeType(Utils::Constants::GLSL_ES_VERT_MIMETYPE);
|
||||||
addMimeType(Utils::Constants::GLSL_MIMETYPE_FRAG_ES);
|
addMimeType(Utils::Constants::GLSL_ES_FRAG_MIMETYPE);
|
||||||
|
|
||||||
setDocumentCreator([]() { return new TextDocument(Constants::C_GLSLEDITOR_ID); });
|
setDocumentCreator([]() { return new TextDocument(Constants::C_GLSLEDITOR_ID); });
|
||||||
setEditorWidgetCreator([]() { return new GlslEditorWidget; });
|
setEditorWidgetCreator([]() { return new GlslEditorWidget; });
|
||||||
|
@@ -119,11 +119,16 @@ void GlslEditorPlugin::initialize()
|
|||||||
void GlslEditorPlugin::extensionsInitialized()
|
void GlslEditorPlugin::extensionsInitialized()
|
||||||
{
|
{
|
||||||
using namespace Utils::Constants;
|
using namespace Utils::Constants;
|
||||||
FileIconProvider::registerIconOverlayForMimeType(":/glsleditor/images/glslfile.png", GLSL_MIMETYPE);
|
FileIconProvider::registerIconOverlayForMimeType(":/glsleditor/images/glslfile.png",
|
||||||
FileIconProvider::registerIconOverlayForMimeType(":/glsleditor/images/glslfile.png", GLSL_MIMETYPE_VERT);
|
GLSL_MIMETYPE);
|
||||||
FileIconProvider::registerIconOverlayForMimeType(":/glsleditor/images/glslfile.png", GLSL_MIMETYPE_FRAG);
|
FileIconProvider::registerIconOverlayForMimeType(":/glsleditor/images/glslfile.png",
|
||||||
FileIconProvider::registerIconOverlayForMimeType(":/glsleditor/images/glslfile.png", GLSL_MIMETYPE_VERT_ES);
|
GLSL_VERT_MIMETYPE);
|
||||||
FileIconProvider::registerIconOverlayForMimeType(":/glsleditor/images/glslfile.png", GLSL_MIMETYPE_FRAG_ES);
|
FileIconProvider::registerIconOverlayForMimeType(":/glsleditor/images/glslfile.png",
|
||||||
|
GLSL_FRAG_MIMETYPE);
|
||||||
|
FileIconProvider::registerIconOverlayForMimeType(":/glsleditor/images/glslfile.png",
|
||||||
|
GLSL_ES_VERT_MIMETYPE);
|
||||||
|
FileIconProvider::registerIconOverlayForMimeType(":/glsleditor/images/glslfile.png",
|
||||||
|
GLSL_ES_FRAG_MIMETYPE);
|
||||||
}
|
}
|
||||||
|
|
||||||
const GlslEditorPlugin::InitFile *GlslEditorPlugin::fragmentShaderInit(int variant)
|
const GlslEditorPlugin::InitFile *GlslEditorPlugin::fragmentShaderInit(int variant)
|
||||||
|
Reference in New Issue
Block a user