summaryrefslogtreecommitdiffstats
path: root/src/corelib/mimetypes
Commit message (Collapse)AuthorAgeFilesLines
* Fix compilation when using -no-mimetype-databaseHelio Chissini de Castro2020-11-061-0/+4
| | | | | | | Change-Id: I4f706a26d73f61e4a6022338e0fc0be48627e4a1 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: David Faure <david.faure@kdab.com> (cherry picked from commit c67ea659e5447fc2d898dbb78189bfe22893522c)
* QMimeDatabase: fix handling of glob-deleteallDavid Faure2020-09-234-17/+26
| | | | | | | | | | | | | | | | | Binary provider: It was not possible to remove the first glob in a local override, because the mainPattern handling would re-add the first glob back. XML provider: It didn't support glob-deleteall. Also, the order of the providers was wrong. We want to pick local overrides first, the internal DB has to go last in the list. Fixes: QTBUG-85436 Change-Id: I9a4523f37cd962c730df9a6ed992bd01c075bf03 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> (cherry picked from commit fc8f5afc874073f91d3770273e0a9164182d7897) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QMimeDatabase: fix performance regression when using the internal XMLDavid Faure2020-09-193-3/+26
| | | | | | | | | | That XML was parsed over and over again, because the QMimeXMLProvider was re-created instead of re-used. Change-Id: I07ff005d3f238afc1490b69a58cf4815e67d418c Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> (cherry picked from commit 354ea7bd963b3c54b4b15d28a595bf836a78de07) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QMimeDatabase/zlib: fix build with z_const macro emptyThiago Macieira2020-06-301-1/+1
| | | | | | | | | | | | The next_in pointer in z_stream is defined as "z_const Bytef *" but z_const is actually an empty macro in most builds. Since our data is read-only constexpr, we need this const_cast to compile. Fixes: QTBUG-84457 Change-Id: Ied637aece2a7427b8a2dfffd1612a01ae46f7c1a Reviewed-by: David Faure <david.faure@kdab.com> (cherry picked from commit cdcb75c46b968dbfeb1992c6bee19aceda27da38) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QMimeDatabase/zstd: use -T1 instead of --single-threadThiago Macieira2020-06-121-1/+1
| | | | | | | | | | | | | Some older versions of the command-line tool don't have --single-thread but do have -T1. They're slightly different according to the documentation, but it's not important to us. What we want is to make sure we consume a single CPU during build. Fixes: QTBUG-84792 Change-Id: Ied637aece2a7427b8a2dfffd16129fe88a0466ee Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> (cherry picked from commit 03dfd4199deb4a0f5123fb1eead42f7e1f85e9e3) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QMimeType::suffixForFileName shouldn't lowercase the file suffixDavid Faure2020-06-024-16/+27
| | | | | | | | | | | | | | It was returning a lowercased suffix because it was extracting it from the pattern (*.txt) rather than from the filename ("README.TXT"). This broke expectations on the application side, since this method is documented to return a suffix from the given filename. Ref: https://bugs.kde.org/show_bug.cgi?id=402388 Change-Id: I7dae13db31280249d3f592fa9592c4067804e22d Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> (cherry picked from commit 4f1ebf666e36020c501e6d3b20d70320b45ab2ec)
* QMimeDatabase/xml: use xmlstarlet instead of xmlEric Lemanissier2020-05-261-2/+2
| | | | | | | | | some distributions (eg Ubuntu) don't provide xml executable, but only xmlstarlet executable Change-Id: Icc801ded8d4ec1ec4d1dab93289a2365f8cd9cbd Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> (cherry picked from commit 370324f6e2f3ce7d250a1c3686918c08da1f8b06) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Mimetypes: Build fix for Android builds on WindowsCristian Adam2020-03-101-2/+5
| | | | | | | | | | | Due to Android's multi-abi the build will fail due to concurrent access: cmd /c C:\Projects\Qt\repo\qtbase\src\corelib\mimetypes\mime\generate.bat C:\Projects\Qt\repo\qtbase\src\corelib\mimetypes\mime\packages\freedesktop.org.xml > .rcc\qmimeprovider_database.cpp The process cannot access the file because it is being used by another process. Change-Id: I647e0a6d8aa03cf116b08a1dce6e61e8882661f4 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* QMimeXMLProvider: fix another issue with -no-mimetype-databaseThiago Macieira2020-03-032-5/+10
| | | | | | | | | | | The compiler must emit the destructor for the members of a class in an inline constructor, in case the constructor throws. This won't work in Qt 5.15 due to QList requiring knowing whether QMimeMagicRuleMatcher is trivial or not. Another solution would be to use QVector. Fixes: QTBUG-82547 Change-Id: Ia8b65350cd5d49debca9fffd15f79db872ed7c0c Reviewed-by: David Faure <david.faure@kdab.com>
* QMimeXMLProvider: add missing semi-colon in the #else caseThiago Macieira2020-02-271-1/+1
| | | | | | Fixes: QTBUG-82547 Change-Id: Ia8b65350cd5d49debca9fffd15f74e22c0536805 Reviewed-by: David Faure <david.faure@kdab.com>
* MIME: Make the internal database direct content, not a Qt resourceThiago Macieira2019-12-107-11/+364
| | | | | | | | | | | | | | | | | | | | | | This saves us from having to bootstrap rcc in regular (non-cross) compilations, as it can now link to QtCore. Actually un-bootstrapping rcc is left as an exercise for the reader. This commit discovered that MSVC cannot handle constexpr arrays bigger than 256 kB, at which point it simply starts claiming that the constant expressions using it are not constexpr. ICC has a similar problem at 64 kB, but it tells you why ("note: type "const unsigned char [65537]" too large for constant-expression evaluation"). Note also that this requires gzip or zstd to be in PATH for compression to happen. RCC linked to zlib, which is always present due to the bundled copy. gzip's presence is not likely to be a problem on Unix systems, but could be for Windows users, especially MSVC ones. If gzip is not present, QtCore's size will increase by about 1910 kB of read-only (sharable) data. Change-Id: I2b1955a995ad40f3b89afffd15a3e65a94670242 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Tidy nullptr usageAllan Sandfeld Jensen2019-12-062-3/+3
| | | | | | | | | | | Move away from using 0 as pointer literal. Done using clang-tidy. This is not complete as run-clang-tidy can't handle all of qtbase in one go. Change-Id: I1076a21f32aac0dab078af6f175f7508145eece0 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* QMimeType: towards re-entrancy: do not cache iconName made from mimetype nameMarc Mutz2019-06-161-6/+9
| | | | | | | | | | | | To not write into a shared object without mutex protection. If the stored icon name is empty, just calculate a new one on each call. Task-number: QTBUG-45684 Change-Id: I01dfb6697b5275e69451da91fdc7346f40bc424e Reviewed-by: David Faure <david.faure@kdab.com>
* QMimeType: make deep const breakages explicitMarc Mutz2019-06-161-9/+10
| | | | | | | | | | | | | QExplicitlySharedDataPointer is propagating const in my tree, and I will be proposing this for inclusion into Qt 6, so proactively fix the breakage here. QMimeType is known to be non-reentrant (QTBUG-45684), and this patch doesn't fix it. Change-Id: If68b148c44439d76ab1d95e8db93b90d12650e51 Reviewed-by: David Faure <david.faure@kdab.com>
* Remove a few usages of deprecated APIShawn Rutledge2019-06-131-1/+1
| | | | | | Change-Id: I94bad0b8d3891c6b4a55178836cfff2a4312e330 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* QtCore: use qUtf16Printable and %ls, qErrnoWarning()Marc Mutz2019-05-291-1/+1
| | | | | | | | | | | | ... instead of qPrintable(), %s, and explicit qt_error_string(). Saves 2KiB in text size on optimized Linux AMD64 GCC 9.1 builds. Change-Id: I98b6717da1ed1b678f01167d704a96f10da47966 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Fix corelib build without feature.regularexpressionTasuku Suzuki2019-05-221-0/+6
| | | | | | | | | | | | | | | | | | | Change-Id: I208d6cb7f57a74873fae3a36fe094a92d287c2f0 Reviewed-by: David Faure <david.faure@kdab.com>
* Remove handling of missing Q_COMPILER_RVALUE_REFSAllan Sandfeld Jensen2019-05-011-19/+0
| | | | | | | | Remove remaining handling of missing support for rvalue refs. Change-Id: I78bab8bccfeeb9c76f464f345874364a37e4840a Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Remove handling of missing Q_COMPILER_RVALUE_REFSAllan Sandfeld Jensen2019-04-082-4/+0
| | | | | Change-Id: I7bc6c455fbae4cdad584c76773299a6d8cd40c82 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Replace Q_DECL_NOEXCEPT with noexcept in corelibAllan Sandfeld Jensen2019-04-035-8/+8
| | | | | | | In preparation of Qt6 move away from pre-C++11 macros. Change-Id: I44126693c20c18eca5620caab4f7e746218e0ce3 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Merge remote-tracking branch 'origin/5.13' into devLiang Qi2019-03-312-1/+3
|\ | | | | | | | | | | | | Conflicts: src/corelib/configure.json Change-Id: I93ac67f3bf4844bc7c691183e94bceb922b7b919
| * QMimeDatabase: allow building without our internal copyThiago Macieira2019-03-262-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Saves 234kB of read-only data (when compressed with zstd) in QtCore, plus one load-time execution. With Zlib, the size was 315 kB. [ChangeLog][QtCore][QMimeDatabase] Added configure option -no-mimetype-database that tells Qt not to bundle its own copy of the XDG MIME database. If this option is passed, QMimeDatabase will only work if there's a system copy in $XDG_DATA_DIRS/mime. This option is useful for Linux distributions that ensure the data is always present. Change-Id: I1004b4b819774c4c9296fffd158e69c490e88fb6 Reviewed-by: David Faure <david.faure@kdab.com>
* | Fix warnings when compiling with QT_NO_XMLSTREAMJędrzej Nowacki2019-03-042-1/+3
|/ | | | | | | | Some of function arguments were unused. Change-Id: I29e8e4acbed87836044cac4f0b7ac59168181f5a Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* QMimeGlobPattern: update use of wildcardToRegularExpresionSamuel Gaist2019-01-261-1/+1
| | | | | | | | | | | Following the update of qtbase because of QTBUG-72539, the code using wildcardToRegularExpression must be updated as anchoredPattern is not needed anymore. Task-number: QTBUG-72539 Change-Id: I4989b42c737eb17d65c6b1d3cefab3ffd2163bfc Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Use QRegularExpression instead of QRegExpLars Knoll2018-12-141-3/+3
| | | | | Change-Id: I14abbf81a9d0fb72f75417da06b6456b8f1a20a2 Reviewed-by: Samuel Gaist <samuel.gaist@idiap.ch>
* Use Q_DISABLE_COPY_MOVE for private classesFriedemann Kleint2018-12-122-2/+2
| | | | | Change-Id: I3cfcfba892ff4a0ab4e31f308620b445162bb17b Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
* RCC: introduce compression algorithm "best"Thiago Macieira2018-12-111-1/+1
| | | | | | | | | | | | | | | | | | | This compression algorithm is permitted in the XML sources, which instructs RCC to apply the best compression algorithm it has available. If we have Zstandard available, that's its level 19 (levels 20 and up are experimental). If not, we apply zlib compression level 9. And apply this technique for the XDG MIME database that is built-in to QtCore. Payload size Compr. time Previously 313916 17.9ms Zlib -9 310899 53.6ms Zstd -14 253364 63.3ms (plus 4.0 ms on L1 heuristic check) Zstd -19 230647 642.5ms Change-Id: I343f2beed55440a7ac0bfffd1562de44dbaf09cd Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Add a few qAsConst() to range-for to prevent detachmentsSergio Martins2018-12-101-2/+2
| | | | | | | | | | | places indicated by clazy As a drive-by, fixed minor styling issues in the affected lines. Change-Id: I88d3fc0c8573cde0e61f19a18dd9ea697ee40c34 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Luca Beldi <v.ronin@yahoo.it> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* QMimeDatabasePrivate: Match shared-mime-info behavior betterAlbert Astals Cid2018-11-131-1/+1
| | | | | | | | | | | | * Take into account alias when resolving inheritance FAIL! : tst_QMimeDatabase::findByFile(sqlite3.kexi) Compared values are not the same Actual (resultMimeTypeName.toLower()): "application/vnd.sqlite3" Expected (mimeTypeName.toLower()) : "application/x-kexiproject-sqlite3" Loc: [/home/tsdgeos/qt/qtbase_dev/tests/auto/corelib/mimetypes/qmimedatabase/qmimedatabase-xml/../tst_qmimedatabase.cpp(841)] Change-Id: Ie5b095669979efef0b1de4175723190ea1f4d5a0 Reviewed-by: David Faure <david.faure@kdab.com>
* QMimeDatabase: update freedesktop.org.xml to shared-mime-info 1.10Albert Astals Cid2018-11-131-1465/+2952
| | | | | | | | Including https://gitlab.freedesktop.org/xdg/shared-mime-info/commit/4f7ad5ec448d38137ddc4de5624215ba0f8ebfa9 to make appimage not ambiguous Change-Id: I8db13fc785b267c09667ef38430bf98135c7f0d6 Reviewed-by: David Faure <david.faure@kdab.com>
* Merge remote-tracking branch 'origin/5.12' into devQt Forward Merge Bot2018-11-063-3/+4
|\ | | | | | | Change-Id: Id1e4664d3c942226b76e2c3b338df3116ff89297
| * QMimeType: Use default key as fallback for comment() propertyGary Wang2018-11-023-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When QMimeProvider parses the shared mime database xml files, it will read the <comment> element for mime comment and treat the `xml:lang` attribute as locale language string. When no `xml:lang` attr is provided, QMimeProvider will read the value and treat it as a en_US locale string as the default key. When we call QMimeType::comment(), it will try to get the locale comment string with the default language (QLocale().name()), once it can't find a matched result, it should return the default key (which QMimeProvider set it as en_US locale before) as fallback. Task-number: QTBUG-71314 Change-Id: I444f8159d6f19dfef6338cd79312f608d8f13394 Reviewed-by: David Faure <david.faure@kdab.com>
* | Merge remote-tracking branch 'origin/5.12' into devLiang Qi2018-10-2516-58/+11
|\| | | | | | | | | | | | | | | | | Conflicts: src/corelib/animation/qpropertyanimation.cpp src/gui/image/qicon.cpp tests/auto/widgets/itemviews/qtableview/tst_qtableview.cpp Change-Id: I3698172b7b44ebb487cb38f50fd2c4a9f8a35b21
| * Merge remote-tracking branch 'origin/5.11' into 5.12Liang Qi2018-10-1716-45/+9
| |\ | | | | | | | | | | | | | | | | | | | | | Conflicts: src/plugins/platformthemes/platformthemes.pro src/printsupport/kernel/qplatformprintdevice.cpp Change-Id: Iac01729ad954bb1c7af5867d982eb243b2139ee6
| | * Modernize the "mimetype" featureLiang Qi2018-10-1216-45/+9
| | | | | | | | | | | | | | | | | | Change-Id: I9b67c2cbc0891a38ece18d521c86fbc7344dce7a Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
| * | Doc: Move literal code block to a separate fileCristian Maureira-Fredes2018-10-151-13/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We need to override this snippet for the documentation we generate for Qt for Python, and it is easier to have it on a separate file. Task-number: PYSIDE-801 Task-number: PYSIDE-691 Change-Id: Ideb5b6af25024279f167137d3b65660bb9c96a7e Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
* | | Use std::unique_ptr for memory management in QMimeDataBasePrivateIvan Komissarov2018-10-222-15/+16
| | | | | | | | | | | | | | | | | | | | | | | | This change simplifies memory management as long as it doesn't requires manuall calls to qDeleteAll and manual deleting/nulling pointers. Change-Id: Id0dc563d0b1e74ae33939d90d4b39999020cd7ce Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
* | | Use a std::vector instead of a QVector in QMimeDatabasePrivateIvan Komissarov2018-09-292-26/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Using std::vector saves a bit c++ code when using range-for loop over the vector. Besides, no shared copies created anymore which is a bit faster. Change-Id: I564306ed9ac907e9f32f59b33ed15c027a59b4eb Reviewed-by: David Faure <david.faure@kdab.com>
* | | Fix a few overrides in Qt CoreAlessandro Portale2018-09-251-8/+8
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change removes redundant 'virtual' from function declarations. Clang Tidy's modernize-use-override check reports: warning: 'virtual' is redundant since the function is already declared 'override' CppCoreGuidelines say: C.128: Virtual functions should specify exactly one of virtual, override, or final Change-Id: I9a4bdd6cc041d46ae64b25597ba4f7268ac4c2b7 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Kevin Funk <kevin.funk@kdab.com>
* | WebAssembly for QtBaseMorten Johan Sørvig2018-08-301-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | This is the squashed diff from wip/webassembly to dev. Done-with: Peng Wu <peng.wu@intopalo.com> Done-with: Sami Enne <sami.enne@intopalo.com> Done-with: Morten Johan Sørvig <morten.sorvig@qt.io> Started-by: Andrew Knight <andrew.knight@intopalo.com> Change-Id: I6562433c0a38d6ec49ab675e0f104f2665f3392d Reviewed-by: Lorn Potter <lorn.potter@gmail.com> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* | QMimeDatabase: Fix MIME detection issues with magics in MIME hierarchiesEike Ziller2018-08-201-2/+5
|/ | | | | | | | | | | | | | | | | | | Assume two MIME types A and B are registered, both with the same glob pattern, A being parent of B, A with some magic rule, and B with another magic rule. Given a file that matches the glob pattern and the magic rule of A, the resulting MIME type depended on the order of registration of A and B, because it would just check if some glob matching MIME type was also a subclass of the magic matching MIME type. The patch prefers the the MIME type that matches by magic if that matches by glob pattern as well (i.e. A in our example). The "recommended checking order" of the spec does handle that case. Task-number: QTBUG-44846 Change-Id: I2af43f6199faf9a42cd9c35d3a045441afbd6217 Reviewed-by: Eike Ziller <eike.ziller@qt.io> Reviewed-by: David Faure <david.faure@kdab.com>
* Fix build for Android with android-clang in r17Liang Qi2018-06-061-10/+6
| | | | | | Task-number: QTBUG-67464 Change-Id: Ib971a5da82b31bce9ac1c9ac623ad7d5302cfaec Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* QMimeDatabase: check 128 bytes rather than 32, for text vs binaryDavid Faure2018-04-271-2/+2
| | | | | | | | As per today's change in the MIME spec. https://bugs.freedesktop.org/show_bug.cgi?id=97372 Change-Id: Iba4fdd95c3ebec8a042404956db3466a46c97f1d Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QMimeDatabase: fix assert when fetching data for invalid mimetypeDavid Faure2018-04-061-0/+2
| | | | | | | | | The Q_ASSERT(mimePrivate.fromCache) at qmimedatabase.cpp:218 which I added in commit 7a5644d648, was being triggered when calling comment() for invalid mimetypes such as db.mimeTypeForName(""). Change-Id: I8037041a4b435d2a5ba24ec94b7858e38b2f0bf2 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QMimeDatabase: fix regression in alias resolvingDavid Faure2018-02-281-2/+2
| | | | | | | | | | | | The refactoring to support multiple providers broke alias resolving (e.g. "text/directory" would be an invalid mimetype, instead of being resolved to "text/vcard"). The unittest didn't catch it because most of it was running with a single mime directory (and therefore a single provider, in the new model). Fixed by re-running a number of test methods once we have a second mime directory. Change-Id: Ib5da89ba79c11ed41813b2aff4bc71c30afcde7d Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QMimeType: remove unwanted *.bin as preferredSuffix for octet-streamDavid Faure2018-01-281-0/+2
| | | | | | | | | | | | This leads to an automatically appended .bin when saving a file. https://bugs.freedesktop.org/show_bug.cgi?id=101667 https://bugs.kde.org/382437 Fixed upstream in shared-mime-info 1.10 Change-Id: I125a0bc72c91a082706bf2bf149adcf63ff1ec6b Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QMimeDatabase: only export var for unittests if QT_BUILD_INTERNALDavid Faure2018-01-021-1/+6
| | | | | Change-Id: I7fa25b64cf39667c8cea95431f68baab623c8a2a Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QMimeMagicRule: fix inconsequential out-of-bounds accessMarc Mutz2017-11-301-1/+1
| | | | | | | | | | The penultimate entry in mimeRuleTypes_strings is "byte", which, incl. the terminating NUL character, has length five. But 65-59 == 6, so the last index in magicRuleType_indices was off by one. No harm done, since there's one more NUL (three in total...), but fix for the next reader of the code. Change-Id: Ibdf855014a313a0486d013c9d06d55cea96435fd Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QMimeDatabase: handle removal of a mime directoryDavid Faure2017-11-301-4/+7
| | | | | | | | | | The previous commit didn't handle correctly the case where an entire mime directory is deleted. The unittest wasn't testing that case, now it is. We need to move providers into a new list, and then delete those left over (i.e. now unused). Change-Id: I04fd8b39b511a2331d706864f695ce5074acf916 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QMimeDatabase: redesign to use both binary and XML providersDavid Faure2017-11-3010-347/+391
| | | | | | | | | | | | | | | | | | | | | | Previously, we would use mime.cache in all mime directories if at least one of them had such a file (other than the most-local one), otherwise the "source" XML would be used in all directories. Now it's possible to use mime.cache in those directories which have one, and XML in those directories that don't. Not only is this more correct, it will allow in a subsequent commit to bundle the binary cache in QtCore's qrc rather than the very big XML file. The design change to allow this is that now every provider only deals with a single directory, and QMimeDatabasePrivate takes care of creating multiple providers, one for each dir. This required to move most of the loops from the binary provider up to QMimeDatabasePrivate itself. Change-Id: Iac82d5f5836b80d45076e586b903d16fa2525b34 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>