aboutsummaryrefslogtreecommitdiffstats
path: root/src/libs/utils/mimetypes/mimeprovider.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Re-fix QtCore resource path changing and prepare for Qt 5.134.9Thiago Macieira2019-07-161-26/+19
| | | | | | | | | | | | | | | | | | | Commit 9cf8ab3b3d44ac50a1f8d4893d8f70b8aedb18b0 added the #ifdef, but that of course only works if you don't upgrade Qt compared to what Qt Creator was compiled with. Instead, attempt both paths and only do that if the system copy is not found. Searching the system copy is required to address Qt 5.13's configure option -no-mimetype-database (used by Linux distributions because the system copy is always present). This code will still need work to deal with Qt 5.14 changes. Task-number: QTCREATORBUG-19600 Task-number: QTCREATORBUG-22636 Change-Id: I6aed4df6a12e43c3ac8efffd15ac952a6e9d4770 Reviewed-by: Dmitry Shachnev <mitya57@gmail.com> Reviewed-by: Orgad Shaneh <orgads@gmail.com>
* Merge remote-tracking branch 'origin/4.7'Eike Ziller2018-08-201-0/+1
|\ | | | | | | Change-Id: I15962a85b0cc37c5a00e15ef7eac0445aad6c295
| * MimeProvider: Add #include <QtGlobal> for version checkOrgad Shaneh2018-08-161-0/+1
| | | | | | | | | | | | | | | | It is required with Qt 5.11. Task-number: QTCREATORBUG-20912 Change-Id: I172caf605a95d560d730d8007f2cf623abc90957 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* | MimeDatabase: Don't pollute global namespaceEike Ziller2018-06-131-2/+2
|/ | | | | | | Task-number: QTCREATORBUG-16119 Change-Id: If234669adf19ccf84b76b99c1a71574f3859eaf1 Reviewed-by: hjk <hjk@qt.io> Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* Fix mime type detection for Qt 5.11Friedemann Kleint2018-01-171-1/+6
| | | | | | | | | Add an #ifdef for the changed path to the QtCore resource following qtbase/7a5644d6481a3c1a7416772998ca4e60c977bfbd. Task-number: QTCREATORBUG-19600 Change-Id: I8fa8bbf9a7ec91ca569f65671eaab1798b129981 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* Move mimetype definitions to plugin specsEike Ziller2017-02-271-11/+20
| | | | | | | | | | | | - Avoids the hassle of QRC files and manually registering mime types - Avoids performance regressions because of mime types that are registered after mime database has been used - Makes it technically possible to detect that a disabled plugin could handle a mime type if it was enabled Change-Id: I373008b1b56e9c6b4853055f20b3eeb112a6eff9 Reviewed-by: Christian Stenger <christian.stenger@qt.io> Reviewed-by: hjk <hjk@qt.io>
* MimeTypes: Slurp in XML contents in one gohjk2017-01-131-1/+2
| | | | | | | | Saves ~3% cycles in MimeTypeParserBase::parse() i.e. ~0.35% of total startup time. Change-Id: Ia69cacae359191bd6e55d38758db315d1992ffad Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* Update License according to agreement with Free Qt FoundationTobias Hunger2016-01-191-15/+21
| | | | | | | * Update remaining files in src Change-Id: I1896f17fcf34f71c3310c87899fb5171b8e4afb1 Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
* MimeDatabase: Remove bestMatch, which was broken beyond repairEike Ziller2015-02-271-56/+0
| | | | | | | | | | | | The problem is that, if you check e.g. a .pro file against all C/C++ mime types, and these define magic matchers, it would find that .pro doesn't match C/C++ mime types by extension, so it would open the file to find a magic match. Even though the extension .pro would identify it already as a qmake .pro file when checking for the mime type globally. Change-Id: I3341187e88e2263bf38169c3c99e5d2161e2a9ee Reviewed-by: Daniel Teske <daniel.teske@theqtcompany.com> Reviewed-by: Orgad Shaneh <orgads@gmail.com>
* MimeDatabase: Fix remaining problems with overriding mime typesEike Ziller2015-02-241-4/+1
| | | | | | | | | | | If mime info is requested during Qt Creator's initialization cycle, the mime files might be parsed before all custom types are registered. To ensure that custom mime types override the built-in ones we must force a complete reload after they are registered. Change-Id: I94032a5efe1bbc22885cbeb1f43080270c23381c Task-number: QTCREATORBUG-13995 Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
* MimeDatabase: Prevent funny mixing of different mime type definitionsEike Ziller2015-02-181-4/+3
| | | | | | | | | | | | | | | | | | | | If multiple definitions for the same mime type are found, the mime XML parser/provider would on the one hand replace the first MimeType instance by the later one, but on the other hand keep all previously parsed glob and magic matchers from the first definition. The patch - makes the XML parser ignore definitions of mime types that are already defined - parses custom types first, so custom types can override types from freedesktop.org.xml This fixes opening Cmake projects (CMakeLists.txt) in Qt Creator, because freedesktop.org.xml defines these files to be x-cmake, but we need them to be x-cmake-project. Change-Id: Ia5598c2d0201f608aed6ae8c3268f0512d822f51 Reviewed-by: Daniel Teske <daniel.teske@theqtcompany.com>
* MimeDatabase: Never use installed mime data.Eike Ziller2015-02-171-17/+17
| | | | | | | | | It gets in the way, e.g. "No plugin can open project type "application/ x-kicad-project"" when trying to open .pro files. Change-Id: I5d8dcb52b65b1e617fe0c6dfcdc94e2cf8fc5f5d Reviewed-by: Tim Sander <tim@krieglstein.org> Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
* MimeDatabase: Allow overriding pattern and magic matchers of mime typesEike Ziller2015-02-171-0/+26
| | | | | Change-Id: I1e2f59c98ab69ccee1eb2eaa8bc6ce918302c6cb Reviewed-by: David Schulz <david.schulz@theqtcompany.com>
* MimeDatabase: Provide access to mime magic rulesEike Ziller2015-02-171-0/+10
| | | | | Change-Id: I9d03db685200e86f71e15fe596b67db1d386eb19 Reviewed-by: David Schulz <david.schulz@theqtcompany.com>
* MimeDatabase: Add bestMatch(fileName, listOfMimeTypesToCheck) method.Eike Ziller2015-02-171-0/+56
| | | | | | | | | | The use case is Qt Creator's C++ model / project parts, where the files of the projects are sorted into C/C++/Objective-C++ Header/Source categories, so we only want to know if a file has one of these 6 mime types. Change-Id: Ia600fa34beb8dfd2fb406c04b2f36e6ab6b25730 Reviewed-by: David Schulz <david.schulz@theqtcompany.com>
* MimeDatabase: Add API for adding mime types from xml filesEike Ziller2015-02-171-0/+11
| | | | | Change-Id: I43e5ef02322636b8212c860f419309323f23445b Reviewed-by: David Schulz <david.schulz@theqtcompany.com>
* MimeDatabase: Never read XML files multiple times.Eike Ziller2015-02-171-1/+1
| | | | | Change-Id: I84bf07b2524d87ace7ce33fe21854f4ae2609f44 Reviewed-by: David Schulz <david.schulz@theqtcompany.com>
* MimeDatabase: Restrict to using XML mime providerEike Ziller2015-02-171-611/+611
| | | | | Change-Id: I335a675d24cd319a5d1d47bb8e8e1ab154d10cef Reviewed-by: David Schulz <david.schulz@theqtcompany.com>
* Add copy of QMimeDatabaseEike Ziller2015-02-171-0/+861
Adapting the names and namespaces. Change-Id: I15b161dfafd5a4112b420160816ee8336e3ebdac Reviewed-by: David Schulz <david.schulz@theqtcompany.com>