summaryrefslogtreecommitdiffstats
path: root/src/corelib/mimetypes
Commit message (Collapse)AuthorAgeFilesLines
* QMimeType: use modernize comparisonsTatiana Borisova13 days2-8/+15
| | | | | | | | | | | | | Replace class operators operator==(), operator!=() of QMimeType to friend method comparesEqual() and Q_DECLARE_EQUALITY_COMPARABLE macro. Use QT_CORE_REMOVED_SINCE and removed_api.cpp to get rid of current comparison methods and replace them with a friend. Task-number: QTBUG-120304 Change-Id: I9776e98c8a3b14d599733c91af61fbc12b1f0e57 Reviewed-by: Ivan Solovev <ivan.solovev@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>
* QMime: remove unused qmap.h includesMarc Mutz2024-02-212-2/+0
| | | | | | | | | | | These TUs never seem to never have used QMap, QMultiMap or QVariantMap, so remove the superfluous includes. Amends ffa5820fa3bf8b28675129919d748373d6c77827. Pick-to: 6.7 6.6 6.5 Change-Id: I3381fced294d7b99d3553d0efde38f20f01e4e97 Reviewed-by: David Faure <david.faure@kdab.com>
* 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>
* QMimeBinaryProvider: cut out the QMap middle-manMarc Mutz2024-02-092-24/+17
| | | | | | | | | | | | | | | | | | | | | | In Qt 6, QMap is just a shared pointer to a std::map. QMimeBinaryProvider::m_mimetypeExtra is never copied, though, so the implicit sharing that QMap adds on top of std::map is useless. Use the underlying std::map directly. Yes, the std::map API is a bit raw around the edges (std::pair value_type), but we're professionals here. Saves more than 1.7KiB in TEXT size on optimized AMD64 GCC 11 C++20 Linux builds. As a drive-by, cut out the insertIt temporary, too, and assign directly to `it`. Change-Id: If3fd98a7e7017909d00b8725f8c252b19459d5b6 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: David Faure <david.faure@kdab.com>
* QMimeBinaryProvider: move CacheFile up in the fileThiago Macieira2024-01-211-27/+27
| | | | | | | | | | | | | | | | Amends 329722a322a80d5ea8d6f9aa993c2fc4995b08a4 ("QMimeBinaryProvider: manage m_cacheFile with a std::unique_ptr"), which added the std::unique_ptr<CacheFile>. This is required because in C++23 std::unique_ptr's destructor became constexpr and is therefore instantiated more eagerly. The type must be fully defined (not forward-declared) when the std::unique_ptr member is initialised in the QMimeBinaryProvider constructors. Fixes: QTBUG-121204 Pick-to: 6.6 6.7 Change-Id: I76ffba14ece04f24b43efffd17ab9a861aff89b8 Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
* 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: handle buggy type definitions with circular inheritanceAlex Henrie2023-11-172-4/+12
| | | | | | | | | | | | | | | | | | | | | This fixes an infinite loop reported by a user who had both the definition of text/javascript from shared-mime-info 2.3 and the definition of text/javascript from shared-mime-info 2.4 installed at the same time. In 2.3, text/javascript is a subtype of application/ecmascript, but in 2.4 application/ecmascript is a subtype of text/javascript. Having both at the same time resulted in circular inheritance. https://gitlab.freedesktop.org/xdg/shared-mime-info/-/merge_requests/258#note_2167707 [ChangeLog][QtCore][QMimeDatabase] Added code to detect and break circular inheritance loops in the MIME data, which were causing infinite loops Pick-to: 6.6 6.5 Change-Id: Ic207b1593a49c7bb88e4fd810d8f88aa630087ce Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: David Faure <david.faure@kdab.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>
* qmimeglobpattern: port some methods to QSVAnton Kudryavtsev2023-10-172-13/+13
| | | | | | | It's private API, so it's safe Change-Id: Ibf35262117c4ce4a1e548fff814a6e7bea362309 Reviewed-by: David Faure <david.faure@kdab.com>
* Doc: QtCore: Fix documentation issuesTopi Reinio2023-10-022-2/+2
| | | | | | | | | | | | | | | * Fix references to Wait Conditions Example, Semaphores Example, and MIME Type Browser Example as they were renamed. * Rename 'Shared Memory' example as its title clashes with the title of another page (sharedmemory.html). src/corelib/global/qfloat16.cpp: * warning: Invalid '\relates' (already a member of 'qfloat16') Pick-to: 6.5 6.6 Change-Id: Ia28be8e3882a7ad1fadcdbd50a657705d58526bd Reviewed-by: Andreas Eliasson <andreas.eliasson@qt.io>
* Remove remnants of Qt for Native Client (NACL)Tor Arne Vestbø2023-09-231-1/+1
| | | | | | | | | The project has been superseded by Qt for WebAssembly and was never supported in Qt 6. Pick-to: 6.6 6.5 Change-Id: I36682cfe3ce6adac76a307b0faba97dcb7c655cc Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QMimeType: simplify implementation of filterStringDavid Faure2023-09-131-8/+2
| | | | | | | As suggested by Ahmad Samir Change-Id: I7f3ef29436a7725b6dceab72bd0f8b01756bf930 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QMimeDatabase: introduce QMimeMagicResult to accumulate magic resultsDavid Faure2023-09-133-18/+29
| | | | | | | | | | Better than two pointer parameters. However it can't be a return value as we initially thought, it's an in/out parameter, in order to compare the results in the current directory with those found in earlier directories. Change-Id: Ic6137f2627703f8d6930c3f7dd1a1102187eef30 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QMimeDatabase: fix glob-deleteall support for the binary providersDavid Faure2023-09-135-88/+54
| | | | | | | | | | | This fixes the recently added QEXPECT_FAIL about glob-deleteall in a local directory (with a binary cache). Before adding a glob match we ask the more-local (higher-precedence) directories if they have a glob-deleteall for that mimetype, and skip it then. This "asking" is a virtual method, implemented for both XML and binary providers. Change-Id: I6e4baf0120749f3331fd2d9254bea750a322b72d Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QMimeDatabase: collect glob patterns from all locationsDavid Faure2023-09-138-226/+234
| | | | | | | | | | | | | | | | | | | A QMimeTypePrivate used to belong to a single provider, which would provide the complete data for it. But since the redesign in commit 7a5644d6481a3c1a741677, each provider represents is a single mime directory, and the merging happens at the QMimeDatabase level. So we need a QMimeType[Private] to be just a name (a "request" for information about this mimetype) and the information for that mimetype is retrieved on demand by querying the providers and either stopping at the first one (e.g. for icons) or merging the data from all of them (e.g. for glob patterns). The XML provider was using QMimeTypePrivate as data storage, give it its own struct QMimeTypeXMLData for that purpose instead. Task-number: QTBUG-116905 Change-Id: Ia0e0d94aa899720dc0b908f40c25317473005af4 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QMimeProvider: reduce scope of variableDavid Faure2023-09-011-1/+1
| | | | | Change-Id: I0914530b76d1a97b4d9216bc670b5a846f1eda72 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QMimeDatabase: fix detection of pattern conflict in different prefixesDavid Faure2023-09-012-12/+21
| | | | | | | | | | Installing a second mimetype with *.txt as glob had a different effect depending on whether it was installed into the same prefix or a different prefix as the one where text/plain is installed. Pick-to: 6.6 Change-Id: I7f54b8efe22f620eb57257745c48fe5402c87626 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* qmimeprovider: use view types moreAnton Kudryavtsev2023-08-161-6/+7
| | | | | Change-Id: Idd6552313d3ef6ba692432858699521c392c70c3 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Give QLocale::uiLanguages() a separator parameterEdward Welbourne2023-08-161-8/+6
| | | | | | | | | | | | | | | | | | | It has always returned dash-joined forms of the locale names, and callers who need an underscore-joined form have been obliged to replace('-', '_') before using them. Given that everything it adds to the list comes from QLocaleId methods that accept a separator, it's trivial to let it offer the same choice to its callers and save them this hassle. Amended code in QTranslater and QMimeType to save them that hassle. [ChangeLog][CoreLib][QLocale] QLocale::uiLanguages() now lets the caller choose what separator to use between the tags that make up each locale-identifier in the list returned. Change-Id: I91fcd0b988d9a64e0e9ad9e851f6cb8c1be8ae50 Reviewed-by: Marc Mutz <marc.mutz@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Fix QMimeType::comment()'s use of UI languages and defaultEdward Welbourne2023-08-091-13/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The MIME database appears to use underscore to join its locale tags, where QLocale::uiLanguages() uses dashes. This meant that lookups by anything but the raw language were failing even when there was an entry in the MIME database for the desired locale. Also, since 6.5, the uiLanguages() list always does contain the locale's own name, so don't add it to the list again. At the same time, the search was putting the "default" key (used by the MIME database parser for the entry with no locale specified) at the end of the list but macOS (at least) uses that for the "en_US" version, omitting "en_US" itself from the locale-specific data, with the result that those using en_US as locale, but with some other languages later in the list, got the translation for one of those languages instead of the en_US one, since they were found before "default" was reached. So insert "default" after the first block of en-entries in which en_US appears, if it does, rather than at the end. As a drive-by, amend a comment about using "pt" as fall-back for "pt_BR"; as it happens, for pt_BR, uiLanguages() will contain "pt" in any case, as pt_BR is the default for "pt". (Like en, pt anomalously defaults to a territory other than the one the language is named after.) So use de_CH -> de as example, instead (and place the comment where the decision is taken). Fixes: QTBUG-105007 Pick-to: 6.6 6.5 Change-Id: I1f4835190748256ce53a51321a94ae450ab7f61e Reviewed-by: Ahmad Samir <a.samirh78@gmail.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Convert remaining QT_NO_XMLSTREAM* to use feature systemEdward Welbourne2023-05-152-15/+15
| | | | | | | | | | | | | | | | Replace the check in qxmlstream.h with a QT_REQUIRE_CONFIG since the code that includes this header does no checking, whether on the define or the feature, so is better off getting told about the missing feature at the point of include than complaining about an undefined type despite its header being overtly included. For the rest, just do the usual transformation to QT_CONFIG(), flipping the ones that were #ifdef rather than #ifndef, so the condition is positive. Shifted a couple of open-braces of classes to the next line, where they belong, in the process. Change-Id: If9c496082f0489b0f9f4070364cbf840e603fce1 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* QMimeProvider: fix a clazy warningAhmad Samir2023-05-071-0/+2
| | | | | | | | Polymorphic class QMimeXMLProvider is copyable. Potential slicing. [-Wclazy-copyable-polymorphic]. Change-Id: I1eff1389140ce9426db32a37df89935a7b3db3a5 Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
* QMimeProvider: de-duplicate some codeAhmad Samir2023-05-071-12/+6
| | | | | | | Drive-by change: use range-for with a QHash::asKeyValueRange(). Change-Id: I173d28d759bef8f23330338127eeff3018af4a55 Reviewed-by: David Faure <david.faure@kdab.com>
* QMimeProvider: use non-const stack variable for better move semanticsAhmad Samir2023-05-071-1/+1
| | | | | Change-Id: I8e539f9c2a9dc4a8aa388c5640b379326c38f817 Reviewed-by: David Faure <david.faure@kdab.com>
* QMimeBinaryProvider: manage m_cacheFile with a std::unique_ptrAhmad Samir2023-05-072-17/+16
| | | | | Change-Id: Ic68772a75c255a3a2880fa49b2456c34e3153493 Reviewed-by: David Faure <david.faure@kdab.com>
* QMimeDatabase: handle glob-deleteall tagsAhmad Samir2023-05-075-1/+91
| | | | | | | | | | | | | | | | | | | | | | | | | | | According to the Freedesktop spec[1], a mimetype that has glob-deleteall overwrites other glob-pattern definitions for a mimetype if it is in a higher precedence dir, the default order is (from high to low) ~/.local/share/mime, /usr/local/share/mime, /usr/share/mime. Or if the XDG_DATA_DIRS env var is set, then it takes precedence. The QMime*ProviderS in m_providers are constructed/stored in that same order, high to low). For QMimeXMLProvider, we can just clear the glob patterns associated with those mimetypes from the lists/maps. For the QMimeBinaryProvider however, we can't change the binary (mmap'ed) cache file, instead check mimetype names against the exclusion list before modifying a QMimeGlobMatchResult. [1] https://specifications.freedesktop.org/shared-mime-info-spec/latest/ar01s02.html This test uses XDG_DATA_DIRS so only viable when USE_XDG_DATA_DIRS is defined. Fixes: QTBUG-101755 Pick-to: 6.5 Change-Id: Icadbdf1027155296377c5a6ab3be8e41b6668325 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: David Faure <david.faure@kdab.com>
* mimetypes/: port to qsizetypeAhmad Samir2023-04-157-26/+31
| | | | | | | | | | | | | | | Fixes compiler warnings about narrowing conversions. Found by compiling with clang and -Wshorten-64-to-32. Drive-by changes: - use range-for instead of an iterator based loop - use strlen("*.") instead of magic number 2 Pick-to: 6.5 Task-number: QTBUG-102461 Change-Id: I0bf2299049c0411ed496468238ca30b69946ffc2 Reviewed-by: David Faure <david.faure@kdab.com>
* Misc: Fix qsizetype-related narrowing coversionsAhmad Samir2023-03-111-3/+3
| | | | | | Task-number: QTBUG-102461 Change-Id: I96757abc50fc45756bc1271a970f819a48021663 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Use QtMiscUtils hex/oct-related helpersAhmad Samir2023-02-071-6/+2
| | | | | | | Thanks to Thiago for pointing them out in review. Change-Id: I14d588a8bd5ba29d43a5daeacfd55d974eb65557 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QtMiscUtils: add some more character helpersAhmad Samir2023-02-071-3/+5
| | | | | | | | | | | | | isHexDigit, isOctalDigit, isAsciiDigit, isAsciiLower, isAsciiUpper, isAsciiLetterOrNumber. This de-duplicates some code through out. Rename two local lambdas that were called "isAsciiLetterOrNumber" to not conflict with the method in QtMiscUtils. Change-Id: I5b631f95b9f109136d19515f7e20b8e2fbca3d43 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QMimeDatabase: don't stat() something that isn't a local fileThiago Macieira2023-02-022-24/+26
| | | | | | | | | | | | | | | | We must check that the path is an actual file on the filesystem before using native APIs. This regression was introduced by commit 047d8f36de45ebb318726167f941b0dbc64754ba. [ChangeLog][QtCore][QMimeDatabase] Fixed a regression from 6.4.0 that made certain QMimeDatabase functions that inspected file contents to fail on Unix systems, if the file was not a native file (e.g., a Qt resource). Fixes: QTBUG-110707 Pick-to: 6.4 6.5 Change-Id: I570832c9ac8b4e03bde8fffd173f7b4c6b164192 Reviewed-by: Igor Kushnir <igorkuo@gmail.com> Reviewed-by: David Faure <david.faure@kdab.com>
* Use QFileInfo's file times in UTC for file timestampsAhmad Samir2023-01-041-2/+2
| | | | | | | | | | | This is inherently faster than getting it in UTC from the underlying native API stat call, then converting it to the Local Time Zone just to compare them. The same goes for any use-case where you get a QDateTime then the first thing you do is call t.to{Msec,Secs}SinceEpoch(). Change-Id: Ic13bcfd99b937c9f10f102ea7741832950a553c6 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Kai Köhne <kai.koehne@qt.io>
* Fix clang-cl compiler warningsPeter Varga2022-12-151-1/+1
| | | | | | | | | | | | - known but unsupported action 'shared' for '#pragma section' [-Wignored-pragmas] - #include resolved using non-portable Microsoft search rules [-Wmicrosoft-include] - variable is used uninitialized whenever switch default is taken [-Wsometimes-uninitialized] Change-Id: I466352ff97a2bcf07e706c045568e581dd08a94e 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>
* Port from container::count() and length() to size() - V5Marc Mutz2022-11-032-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a semantic patch using ClangTidyTransformator as in qtbase/df9d882d41b741fef7c5beeddb0abe9d904443d8, but extended to handle typedefs and accesses through pointers, too: const std::string o = "object"; auto hasTypeIgnoringPointer = [](auto type) { return anyOf(hasType(type), hasType(pointsTo(type))); }; auto derivedFromAnyOfClasses = [&](ArrayRef<StringRef> classes) { auto exprOfDeclaredType = [&](auto decl) { return expr(hasTypeIgnoringPointer(hasUnqualifiedDesugaredType(recordType(hasDeclaration(decl))))).bind(o); }; return exprOfDeclaredType(cxxRecordDecl(isSameOrDerivedFrom(hasAnyName(classes)))); }; auto renameMethod = [&] (ArrayRef<StringRef> classes, StringRef from, StringRef to) { return makeRule(cxxMemberCallExpr(on(derivedFromAnyOfClasses(classes)), callee(cxxMethodDecl(hasName(from), parameterCountIs(0)))), changeTo(cat(access(o, cat(to)), "()")), cat("use '", to, "' instead of '", from, "'")); }; renameMethod(<classes>, "count", "size"); renameMethod(<classes>, "length", "size"); except that the on() matcher has been replaced by one that doesn't ignoreParens(). a.k.a qt-port-to-std-compatible-api V5 with config Scope: 'Container'. Added two NOLINTNEXTLINEs in tst_qbitarray and tst_qcontiguouscache, to avoid porting calls that explicitly test count(). Change-Id: Icfb8808c2ff4a30187e9935a51cad26987451c22 Reviewed-by: Ivan Solovev <ivan.solovev@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Port from qAsConst() to std::as_const()Marc Mutz2022-10-113-7/+7
| | | | | | | | | | | | | | | | We've been requiring C++17 since Qt 6.0, and our qAsConst use finally starts to bother us (QTBUG-99313), so time to port away from it now. Since qAsConst has exactly the same semantics as std::as_const (down to rvalue treatment, constexpr'ness and noexcept'ness), there's really nothing more to it than a global search-and-replace, with manual unstaging of the actual definition and documentation in dist/, src/corelib/doc/ and src/corelib/global/. Task-number: QTBUG-99313 Change-Id: I4c7114444a325ad4e62d0fcbfd347d2bbfb21541 Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
* Port from container.count()/length() to size()Marc Mutz2022-10-043-13/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is semantic patch using ClangTidyTransformator: auto QtContainerClass = expr(hasType(namedDecl(hasAnyName(<classes>)))).bind(o) makeRule(cxxMemberCallExpr(on(QtContainerClass), callee(cxxMethodDecl(hasAnyName({"count", "length"), parameterCountIs(0))))), changeTo(cat(access(o, cat("size"), "()"))), cat("use 'size()' instead of 'count()/length()'")) a.k.a qt-port-to-std-compatible-api with config Scope: 'Container'. <classes> are: // sequential: "QByteArray", "QList", "QQueue", "QStack", "QString", "QVarLengthArray", "QVector", // associative: "QHash", "QMultiHash", "QMap", "QMultiMap", "QSet", // Qt has no QMultiSet Change-Id: Ibe8837be96e8d30d1846881ecd65180c1bc459af Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* QMimeMagicRule: use qOffsetStringArray for storing typesSona Kurazyan2022-09-061-17/+15
| | | | | | | | Each element of the array corresponds to an item in QMimeMagicRule::Type enum, so dropped the last empty string of the array which is not used. Change-Id: I4786afaa58287c26d4525180fe6fa6891ddcde26 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Change the license of all CMakeLists.txt and *.cmake files to BSDLucie Gérard2022-08-231-1/+1
| | | | | | | Task-number: QTBUG-105718 Change-Id: I5d3ef70a31235868b9be6cb479b7621bf2a8ba39 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* Add license headers to cmake filesLucie Gérard2022-08-031-0/+3
| | | | | | | | | | | | CMakeLists.txt and .cmake files of significant size (more than 2 lines according to our check in tst_license.pl) now have the copyright and license header. Existing copyright statements remain intact Task-number: QTBUG-88621 Change-Id: I3b98cdc55ead806ec81ce09af9271f9b95af97fa Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* Use SPDX license identifiersLucie Gérard2022-05-1619-696/+45
| | | | | | | | | | | | | 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>
* Replace uses of _qs with _s in sources and examplesSona Kurazyan2022-04-191-2/+2
| | | | | | Task-number: QTBUG-101408 Change-Id: I48360ba3b23965cd3d90ac243c100a0656a4cde8 Reviewed-by: Marc Mutz <marc.mutz@qt.io>
* Apply Q_CONSTINIT across the codebaseMarc Mutz2022-03-291-0/+1
| | | | | | | | | Still not complete. Just grepping for static and thread_local. Task-number: QTBUG-100486 Change-Id: I90ca14e8db3a95590ecde5f89924cf6fcc9755a3 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QtCore: Replace remaining uses of QLatin1String with QLatin1StringViewSona Kurazyan2022-03-264-45/+46
| | | | | | | Task-number: QTBUG-98434 Change-Id: Ib7c5fc0aaca6ef33b93c7486e99502c555bf20bc Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Marc Mutz <marc.mutz@qt.io>
* QtCore: replace QLatin1String/QLatin1Char with _L1/u'' where applicableSona Kurazyan2022-03-256-68/+81
| | | | | | | | | | | As a drive-by, did also minor refactorings/improvements. Task-number: QTBUG-98434 Change-Id: I81964176ae2f07ea63674c96f47f9c6aa046854f Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Anton Kudryavtsev <antkudr@mail.ru>
* Core: Do not depend on transitive includesFabian Kosmale2022-03-174-0/+4
| | | | | Change-Id: I2c71188a4d27692a2d6ef1aa447b329627214b17 Reviewed-by: Marc Mutz <marc.mutz@qt.io>
* MIME providers: Make provider implementations finalEike Ziller2022-03-021-2/+2
| | | | | | | | | We do not derive from them, and making QMimeXMLProvider final avoids a warning about calling a virtual function from the constructor. Change-Id: I565c63eb555fabb3c98e7d284b54037b7a7194da Reviewed-by: David Faure <david.faure@kdab.com>
* QMimeMagicRule: Fix missing check and return for "Invalid" typeEike Ziller2022-03-021-2/+5
| | | | | | | In the QMimeMagicRule constructor. Change-Id: Icdd1c4bc0e8d7cc39c8f63b416deec84b2607c96 Reviewed-by: David Faure <david.faure@kdab.com>