summaryrefslogtreecommitdiffstats
path: root/src/corelib/mimetypes/mime
Commit message (Collapse)AuthorAgeFilesLines
* Replace 'Qt Designer' and 'Qt Widgets Designer' in codeKai Köhne5 days1-31/+31
| | | | | | | | Use new term in examples, code comments, error messages and and mime types. Task-number: QTBUG-122253 Change-Id: I355452d6eb02a7a0ffbb20acf82ddb8ebbfa4837 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Correct license for tools filesLucie Gérard2024-03-051-1/+1
| | | | | | | | | | | | According to QUIP-18 [1], all tools file should be LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 [1]: https://contribute.qt-project.org/quips/18 Pick-to: 6.7 Task-number: QTBUG-121787 Change-Id: Icd5d5be2e04819617e68ff142924de1773bebbad Reviewed-by: Kai Köhne <kai.koehne@qt.io>
* Change license in files to avoid LGPL and non-LGPL license mixLucie Gérard2024-02-201-1/+1
| | | | | | | | | | | | | | | | | | | | According to QUIP-18 [1], all module files should be LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only or LicenseRef-Qt-Commercial OR GPL-3.0-only LGPD and non-LGPL licenses should not be mixed in a given directory. The files in this patch are the only ones in their directory with non-LGPL license. The license is changed to that of the other module files in the same directory. [1]: https://contribute.qt-project.org/quips/18 Pick-to: 6.7 Task-number: QTBUG-121787 Change-Id: Id58248a6f60438e01e77e9448f07e3057d173260 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* QMimeDatabase: update freedesktop.org.xml to shared-mime-info 2.4David Faure2023-11-201-672/+940
| | | | | | | | | | | | A severe incompatibility was detected in 2.3, which is why 2.4 is being released so soon afterwards. The mimetype for *.bz2 files changed (from bzip to bzip2), breaking much code in KDE for instance. This is now handled in a more compatible way. And the two last-minute fixes in the Qt copy of 2.3 are part of 2.4, so this is now more in line with upstream shared-mime-info. Change-Id: Ibca358cf2ca9f341d148f54bb18044683c4a05eb Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
* QMimeDatabase: update freedesktop.org.xml to shared-mime-info 2.3David Faure2023-11-071-4770/+5662
| | | | | | | | | | | | | | | | | ... and update the unittest accordingly. Compared to the 2.3 release there 2 fixes in freedesktop.org.xml, due to issues discovered when running tst_qmimedatabase: * Give higher priority to the more specific image/apng magic https://gitlab.freedesktop.org/xdg/shared-mime-info/-/merge_requests/262 * Lower priority for text/x-mpsub's magic https://gitlab.freedesktop.org/xdg/shared-mime-info/-/merge_requests/263 Task-number: QTBUG-118616 Change-Id: I56053b343619a8a711af28e6490c160d13169734 Reviewed-by: Liang Qi <liang.qi@qt.io> Reviewed-by: Ahmad Samir <a.samirh78@gmail.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Replace the scripting-based mime types compression mechanism with CMakeAlexey Edelev2022-12-012-141/+0
| | | | | | | | | | | | | | | | Use tools that compress mimetypes database directly from CMake as a fallback mechanism instead of using perl and batch scripts. Move the generating of the mimetype database resources to build-time. This removes the perl-based compression from the possible compression options. But assume that CMake-based compression should fill this gap. CMake versions less than 3.26 don't support the value of the zstd compression level higher than 9, so we prefer to use the External API. Task-number: QTBUG-108438 Change-Id: I5686a53b766a243052cfee320f570e2c3b385726 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Use SPDX license identifiersLucie Gérard2022-05-163-80/+5
| | | | | | | | | | | | | Replace the current license disclaimer in files by a SPDX-License-Identifier. Files that have to be modified by hand are modified. License files are organized under LICENSES directory. Task-number: QTBUG-67283 Change-Id: Id880c92784c40f3bbde861c0d93f58151c18b9f1 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* Update shared-mime-info to the 2.2 releaseLiang Qi2022-05-111-35137/+35850
| | | | | | | | | This also includes the fix for x-objc++src mimetype. Fixes: QTBUG-70739 Pick-to: 6.3 6.2 5.15 Change-Id: I24f70fa5cea2e5b1a7877569be98d36878fcfe72 Reviewed-by: David Faure <david.faure@kdab.com>
* Fix internal mimetypes db on Windows when compressed by an external toolHannah von Reth2021-11-091-0/+1
| | | | | | | | | Ensure to use binary encoding when handling the output of the compression tool. With out this change \r are dropped and the compressed file is corrupted. Change-Id: Iaf9b1fc015a376682f793aff079f45d03b201aec Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QMimeDatabase/xml: support both 'xmlstarlet' and 'xml' for minifying XMLKai Köhne2021-01-251-0/+4
| | | | | | | | | | | | | Commit 370324f6e2f3 changed the call to 'xml' to 'xmlstarlet' because some Linux distributions do not provide a binary called xml. Anyhow, the official Windows packages of xmlstarlet only provide 'xml.exe'. Therefore just check for both. Pick-to: 5.15 6.0 Change-Id: I4381b256850e4101b760df21f2b0baffb4414620 Reviewed-by: Eric Lemanissier <eric.lemanissier@gmail.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Update shared-mime-info to the 2.1 release, adjust implementationDavid Faure2021-01-051-7038/+8857
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The spec hasn't changed, but I made the same mistake in xdgmime (the reference implementation) and in Qt: when multiple globs match, and the result from magic sniffing is unrelated to any of those globs, then I used the magic result, but that's wrong, globs have priority and one of them should be picked up. This is now fixed in xdgmime (https://gitlab.freedesktop.org/xdg/xdgmime/-/merge_requests/3) and in the expected results in shared-mime-info (https://gitlab.freedesktop.org/xdg/shared-mime-info/-/merge_requests/99) which this commit is also tested against. This change also optimizes QMimeBinaryProvider::addFileNameMatches to have the same logic as xdgmime for glob matching: literals > extensions > other globs As soon as one category matches, we can stop there. This makes no difference in the overall results, in practice. The user bug report (against the Qt implementation, actually) is https://gitlab.freedesktop.org/xdg/shared-mime-info/-/issues/138 as well as https://bugs.kde.org/show_bug.cgi?id=411718 Pick-to: 6.0 5.15 Change-Id: Ia0a34080427daff43c732609443ee6df8f41447c Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* 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 Pick-to: 5.15 Change-Id: Ied637aece2a7427b8a2dfffd16129fe88a0466ee Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* 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 Pick-to: 5.15 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* MIME: Make the internal database direct content, not a Qt resourceThiago Macieira2019-12-103-0/+229
| | | | | | | | | | | | | | | | | | | | | | 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>
* 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>
* QMimeDatabase: update freedesktop.org.xml to shared-mime-info 1.8David Faure2017-05-081-2719/+10499
| | | | | | | | | | | | ... and update the unittest accordingly. Compared to the 1.8 release there is one change in freedesktop.org.xml, the magic for application/x-java-keystore was changed from host32 to big32, as done upstream, see https://bugs.freedesktop.org/show_bug.cgi?id=99328 Task-number: QTBUG-60608 Change-Id: I47de71c9396cfc3eabc884d5679c73a3e4850a17 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Import QMimeType / QMimeDatabase into QtCore.David Faure2012-02-181-0/+31966
History of the development before the import: ssh://codereview.qt-project.org/playground/mimetypes.git Mimetype definitions come from shared-mime-info where available (UNIX systems), loaded using a mmap'ed binary cache generated by update-mime-database. As a fallback if no cache is found, we parse the raw XML files otherwise. This makes the MIME type support fast and with very low memory usage on UNIX, and it makes it easy to use on Windows (no dependency on shared-mime-info, Qt even includes a freedesktop.xml file to use if none are found on the system). Change-Id: I27b05008216ff936dc463bd80d3893422bfb940e Reviewed-by: Richard J. Moore <rich@kde.org>