cmakeprojectmanager2 icon indicating copy to clipboard operation
cmakeprojectmanager2 copied to clipboard

Use restricted MIME types info for tree building

Open h4tr3d opened this issue 7 years ago • 0 comments

Currently every file scanned by Tree Builder checks with MIME database API to detect it type. It requires a lot of time for processing on big projects (~400k files in my case).

Suggested behavior:

  • Ask internal all mime types on start
  • Walk by Qt Creator supported mime types
  • Compose Hash Map with extension -> file type alias.

File type detection algo:

  • If it supported by "Binary Editor" or "Plain Text Editor" -> UnknownType
  • If it supported by "Form Editor" -> FormType
  • If it supported by "Resource Editor" -> ResourceType
  • It it supported by "QMLJS Editor" -> QMLType
  • If it supported by "Scxml Editor" -> SomeDiagramType // not correct here
  • All other supported by QtC -> SourceType

Known exclusions:

  • .S, .asm - supported by Plain Text Editor, but should be mapped to SourceType

File ext and File Type mapping can be done only once per QtC running: QtC does not allow turn on/off plugins dynamically

Helpful info: Core constants:

coreplugin/coreconstants.h:
const char K_DEFAULT_TEXT_EDITOR_ID[] = "Core.PlainTextEditor";
const char K_DEFAULT_BINARY_EDITOR_ID[] = "Core.BinaryEditor";

Self defined (to avoid dependency on plugin):

const char C_QMLJSEDITOR_ID[] = "QMLProjectManager.QMLJSEditor";
const char RESOURCEEDITOR_ID[] = "Qt4.ResourceEditor";
const char K_DESIGNER_XML_EDITOR_ID[] = "FormEditor.DesignerXmlEditor";

h4tr3d avatar Nov 02 '16 10:11 h4tr3d