Commit 750aeb91 authored by Tobias Hunger's avatar Tobias Hunger

Remove duplicate mime type constants from CppEditor

Use those in its dependency CppTools instead.

Change-Id: I376782863784a878e84ce2cd5d0c6da68b05ab61
Reviewed-by: default avatarEike Ziller <eike.ziller@theqtcompany.com>
parent 285f28b4
......@@ -47,11 +47,6 @@ const char OPEN_TYPE_HIERARCHY[] = "CppEditor.OpenTypeHierarchy";
const char INCLUDE_HIERARCHY_ID[] = "CppEditor.IncludeHierarchy";
const char OPEN_INCLUDE_HIERARCHY[] = "CppEditor.OpenIncludeHierarchy";
const char C_SOURCE_MIMETYPE[] = "text/x-csrc";
const char C_HEADER_MIMETYPE[] = "text/x-chdr";
const char CPP_SOURCE_MIMETYPE[] = "text/x-c++src";
const char CPP_HEADER_MIMETYPE[] = "text/x-c++hdr";
const char CPP_SNIPPETS_GROUP_ID[] = "C++";
const char CPP_PREPROCESSOR_PROJECT_PREFIX[] = "CppPreprocessorProject-";
......
......@@ -83,10 +83,10 @@ public:
{
setId(Constants::CPPEDITOR_ID);
setDisplayName(qApp->translate("OpenWith::Editors", Constants::CPPEDITOR_DISPLAY_NAME));
addMimeType(Constants::C_SOURCE_MIMETYPE);
addMimeType(Constants::C_HEADER_MIMETYPE);
addMimeType(Constants::CPP_SOURCE_MIMETYPE);
addMimeType(Constants::CPP_HEADER_MIMETYPE);
addMimeType(CppTools::Constants::C_SOURCE_MIMETYPE);
addMimeType(CppTools::Constants::C_HEADER_MIMETYPE);
addMimeType(CppTools::Constants::CPP_SOURCE_MIMETYPE);
addMimeType(CppTools::Constants::CPP_HEADER_MIMETYPE);
setDocumentCreator([]() { return new CppEditorDocument; });
setEditorWidgetCreator([]() { return new CppEditorWidget; });
......@@ -268,13 +268,13 @@ void CppEditorPlugin::extensionsInitialized()
if (!HostOsInfo::isMacHost() && !HostOsInfo::isWindowsHost()) {
FileIconProvider::registerIconOverlayForMimeType(
QIcon(creatorTheme()->imageFile(Theme::IconOverlayCppSource, QLatin1String(":/cppeditor/images/qt_cpp.png"))),
Constants::CPP_SOURCE_MIMETYPE);
CppTools::Constants::CPP_SOURCE_MIMETYPE);
FileIconProvider::registerIconOverlayForMimeType(
QIcon(creatorTheme()->imageFile(Theme::IconOverlayCSource, QLatin1String(":/cppeditor/images/qt_c.png"))),
Constants::C_SOURCE_MIMETYPE);
CppTools::Constants::C_SOURCE_MIMETYPE);
FileIconProvider::registerIconOverlayForMimeType(
QIcon(creatorTheme()->imageFile(Theme::IconOverlayCppHeader, QLatin1String(":/cppeditor/images/qt_h.png"))),
Constants::CPP_HEADER_MIMETYPE);
CppTools::Constants::CPP_HEADER_MIMETYPE);
}
}
......
......@@ -29,7 +29,7 @@
#include <designer/qtdesignerformclasscodegenerator.h>
#include <qtsupport/qtsupportconstants.h>
#include <cppeditor/cppeditorconstants.h>
#include <cpptools/cpptoolsconstants.h>
#include <QDebug>
......@@ -43,12 +43,12 @@ FormClassWizard::FormClassWizard()
QString FormClassWizard::headerSuffix() const
{
return preferredSuffix(QLatin1String(CppEditor::Constants::CPP_HEADER_MIMETYPE));
return preferredSuffix(QLatin1String(CppTools::Constants::CPP_HEADER_MIMETYPE));
}
QString FormClassWizard::sourceSuffix() const
{
return preferredSuffix(QLatin1String(CppEditor::Constants::CPP_SOURCE_MIMETYPE));
return preferredSuffix(QLatin1String(CppTools::Constants::CPP_SOURCE_MIMETYPE));
}
QString FormClassWizard::formSuffix() const
......
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