summaryrefslogtreecommitdiffstats
path: root/tests/auto/corelib/mimetypes
Commit message (Collapse)AuthorAgeFilesLines
* QMimeType: use modernize comparisonsTatiana Borisova4 days2-4/+28
| | | | | | | | | | | | | 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>
* Change license for tests filesLucie Gérard2024-02-047-7/+7
| | | | | | | | | | | | According to QUIP-18 [1], all tests file should be LicenseRef-Qt-Commercial OR GPL-3.0-only [1]: https://contribute.qt-project.org/quips/18 Pick-to: 6.7 Task-number: QTBUG-121787 Change-Id: I9657df5d660820e56c96d511ea49d321c54682e8 Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
* Exclude test from compilation without qprocessKrzysztof Sommerfeld2024-01-311-0/+4
| | | | | Change-Id: Iea3a28b25bdb828b0eb2ae0381489aa207f348fd Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QMimeDataBase: Remove dead codeAxel Spoerl2024-01-161-20/+0
| | | | | | | | Remove dead code. Task-number: QTBUG-118566 Change-Id: I4fd912a891733cc1624be2a631cb47f930b82963 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Long live QSpan as public API!Marc Mutz2023-12-071-1/+1
| | | | | | | | | | | Provide qspan_p.h as backward-compatibility header. [ChangeLog][QtCore][QSpan] New Qt equivalent of std::span. Fixes: QTBUG-115022 Change-Id: I1cc27dc0aa1f7406f0a41d7a75f176cd7f858feb Reviewed-by: Ivan Solovev <ivan.solovev@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QMimeDatabase: update freedesktop.org.xml to shared-mime-info 2.4David Faure2023-11-201-3/+5
| | | | | | | | | | | | 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-174-0/+23
| | | | | | | | | | | | | | | | | | | | | 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-10/+24
| | | | | | | | | | | | | | | | | ... 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>
* QMimeType: simplify implementation of filterStringDavid Faure2023-09-132-0/+22
| | | | | | | As suggested by Ahmad Samir Change-Id: I7f3ef29436a7725b6dceab72bd0f8b01756bf930 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QMimeDatabase: fix glob-deleteall support for the binary providersDavid Faure2023-09-131-4/+0
| | | | | | | | | | | 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-135-102/+24
| | | | | | | | | | | | | | | | | | | 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>
* tst_qmimedatabase: move local override to the specific test methodDavid Faure2023-09-135-29/+41
| | | | | | | | | | | | | | | | | | When running tst_qmimedatabase with the full shared-mime-info test suite (which unfortunately requires local setup so this is easy to overlook), we need *.webm to still be associated with video/webm. So to test glob-deleteall, do that in installNewLocalMimeType(), with other similar tests. This however unearthed the following bug: the handling of glob-deleteall is only correct when the local dir has no binary cache. It's broken when using a binary cache. Added a QEXPECT_FAIL for now because this is going to be fixed as part of a major redesign, coming up. I also found out that neither xdgmime nor gio do this correctly... Change-Id: Ib075fcdb792f60a859f23db8c2d7e1c6524f9050 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* tst_qmimedatabase: separate xml files for Global and Local testsDavid Faure2023-09-133-41/+50
| | | | | | | | | | | | For historic reasons, the test had a single list of override xml files to copy first into the global dir, and then into the local dir. But glob-deleteall only makes sense in the local dir (as per the MIME spec). Having two definitions for the same mimetype in the same dir is undefined behavior, so the test was working by chance only, and my upcoming refactoring/fixes caught that. Change-Id: I4717683b4b3f9ba69f1fd815669460789700e877 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QMimeDatabase: fix detection of pattern conflict in different prefixesDavid Faure2023-09-014-10/+28
| | | | | | | | | | 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>
* tst_qmimedatabase: compile with QT_NO_FOREACH; port to ranged-forAhmad Samir2023-08-191-6/+5
| | | | | | | | | | | | | | | msgMimeTypeForFileNameFailed(): the method takes the container by const& and I've made the container const at the call site, so now it's iterating over a const container. allMimeTypes(): iterating over a const container. checkHasMimeType(): was iterating over a temporary, store it in a const auto variable. Task-number: QTBUG-115839 Change-Id: If10eb425d55484bc1857dfdeafa9d65b2beb765f Reviewed-by: David Faure <david.faure@kdab.com>
* Mark all of Qt as free of Q_FOREACH, except where it isn'tMarc Mutz2023-08-191-0/+2
| | | | | | | | | | | | | | | | | | | | | | The density of Q_FOREACH uses in this and some other modules is still extremely high, too high for anyone to tackle in a short amount of time. Even if they're not concentrated in just a few TUs, we need to make progress on a global QT_NO_FOREACH default, so grab the nettle and stick to our strategy: Mark the whole of Qt with QT_NO_FOREACH, to prevent new uses from creeping in, and whitelist the affected TUs by #undef'ing QT_NO_FOREACH locally, at the top of each file. For TUs that are part of a larger executable, this requires these files to be compiled separately, so add them to NO_PCH_SOURCES (which implies NO_UNITY_BUILD_SOURCES, too). In tst_qglobal.cpp and tst_qcollections.cpp change the comment on the #undef QT_NO_FOREACH to indicate that these actually test the macro. Task-number: QTBUG-115839 Change-Id: Iecc444eb7d43d7e4d037f6e155abe0e14a00a5d6 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* tst_QMimeDatabase{Xml,Cache}: make the two siblings behave the sameMarc Mutz2023-08-092-8/+1
| | | | | | | | | | | | | First include the common tst_qmimedatabase.cpp (and nothing else), then implement the differing tst_QMimeDatabase::initTestCaseInternal(). This will allow adding #undef QT_NO_FOREACH to tst_qmimedatabase.cpp in the next step. Pick-to: 6.6 6.5 Change-Id: Icc1890229e9443bd35c81d4f0440ba7df5da906c Reviewed-by: David Faure <david.faure@kdab.com>
* Skip tst_QMimeDatabase::mimeTypeForUnixSpecials_data when AT_FDCWD is not ↵Jacek Poplawski2023-07-281-0/+4
| | | | | | | defined Change-Id: I6fd3bb3e56733b79f349934319a071f8eabaf0ea Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* CMake: Make corelib tests standalone projectsAlexandru Croitor2023-07-053-0/+18
| | | | | | | | | | | | | | | | | | Add the boilerplate standalone test prelude to each test, so that they can be opened with an IDE without the qt-cmake-standalone-test script, but directly with qt-cmake or cmake. Boilerplate was added using the following scripts: https://git.qt.io/alcroito/cmake_refactor Manual adjustments were made where the code was inserted in the wrong location. Task-number: QTBUG-93020 Change-Id: I28b6d3815c5f43d2c33ea65764f6f3f8f129eaf3 Reviewed-by: Amir Masoud Abdol <amir.abdol@qt.io> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QMimeDatabase: de-duplicate some code in the unittestsAhmad Samir2023-05-071-3/+1
| | | | | Change-Id: I7452a61b4c6e1f6b6b0f285aa3391fcd79a3e36d Reviewed-by: David Faure <david.faure@kdab.com>
* QMimeDatabase: handle glob-deleteall tagsAhmad Samir2023-05-073-1/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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-151-1/+1
| | | | | | | | | | | | | | | 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>
* QMimeDatabase: cleanup unittestAhmad Samir2023-03-111-10/+11
| | | | | | | Use QLatin1StringView directly, instead of const char[]. Change-Id: Iae15b9f92d959efc6414ec8549b86560604dfb01 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* tests: Remove remains of qmake conversion from CMakeLists.txt filesFriedemann Kleint2023-02-175-24/+0
| | | | | | | Pick-to: 6.5 Change-Id: I8d106554bb86ac1ec9bb7a4083de4c376bcbab1d Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* QMimeDatabase: add a test to ensure we can detect Unix specialsThiago Macieira2023-02-022-0/+82
| | | | | | Pick-to: 6.4 6.5 Change-Id: I570832c9ac8b4e03bde8fffd173f7e743f42f22b Reviewed-by: David Faure <david.faure@kdab.com>
* QMimeDatabase: don't stat() something that isn't a local fileThiago Macieira2023-02-024-0/+61
| | | | | | | | | | | | | | | | 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>
* tst_QMimeDatabase: rename test to indicate what it really isThiago Macieira2023-02-022-4/+5
| | | | | | | | | This test is calling mimeTypeForFileNameAndData(), so it doesn't actually use the files. Change-Id: I570832c9ac8b4e03bde8fffd173f77f138ef3434 Reviewed-by: Igor Kushnir <igorkuo@gmail.com> Reviewed-by: David Faure <david.faure@kdab.com>
* QMimeDatabase: use unique QTest data tag namesAhmad Samir2023-02-011-4/+4
| | | | | Change-Id: I5f0b270df344b0a8511d48f3cde34643f3115445 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QFileInfo: use currentDateTimeUtc()Ahmad Samir2023-01-061-1/+1
| | | | | | | | Instead of the more verbose currentDateTime(QTZ::UTC). Pick-to: 6.5 Change-Id: Ie759f4270b12fca39c458bf85c8296f5342033db Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Use QFileInfo's file times in UTC for file timestampsAhmad Samir2023-01-041-1/+1
| | | | | | | | | | | 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>
* Port from container::count() and length() to size() - V5Marc Mutz2022-11-031-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 container.count()/length() to size()Marc Mutz2022-10-041-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* Change the license of all CMakeLists.txt and *.cmake files to BSDLucie Gérard2022-08-235-5/+5
| | | | | | | 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-035-0/+15
| | | | | | | | | | | | 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>
* CMake: Don't use PUBLIC_LIBRARIES for tests and test helpersAlexandru Croitor2022-07-283-3/+3
| | | | | Change-Id: I9b7404e1d3a78fe0726ec0f5ce1461f6c209e90d Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
* Use SPDX license identifiersLucie Gérard2022-05-166-162/+12
| | | | | | | | | | | | | 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-5/+5
| | | | | | | | | 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>
* Tests: Do not depend on transitive includesFabian Kosmale2022-03-171-0/+1
| | | | | Change-Id: Ibc6a948480a904913a5427e6408d4d296784fb4f Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
* Remove unused .qrc filesJoerg Bornemann2022-01-171-14/+0
| | | | | | | | Task-number: QTBUG-94446 Change-Id: I136d8b4ab070a832866aa50b5701fc6bd863df8a Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Alexey Edelev <alexey.edelev@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Compile autotests for IntegrityTatiana Borisova2021-09-201-2/+5
| | | | | | | | | - process environment/DNS are OFF for INTEGRITY Task-number: QTBUG-96176 Pick-to: 6.2 Change-Id: I189a97f88c96a428586c31a66b8d250e04482900 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Fix BASE argument of qt_add_resourcesJoerg Bornemann2021-05-182-80/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The BASE argument of qt_add_resources now denotes the root point of the alias of the file. Before, BASE was merely prepended to every file that got passed to qt_add_resources. Old behavior: qt_add_resources(app "images" PREFIX "/" BASE "../shared" FILES "images/button.png") Alias is "../shared/images/button.png", and pro2cmake generated QT_RESOURCE_ALIAS assignments to fix this. New behavior: qt_add_resources(app "images" PREFIX "/" BASE "../shared" FILES "../shared/images/button.png") The alias is "images/button.png". No extra QT_RESOURCE_ALIAS assignment is needed. The new behavior is in effect for user projects and for Qt repositories that define QT_USE_FIXED_QT_ADD_RESOURCE_BASE. Qt repositories will be ported one by one to this new behavior. Then the old code path can be removed. Pick-to: 6.1 Task-number: QTBUG-86726 Change-Id: Ib895edd4df8e97b54badadd9a1c34408beff131f Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Remove .prev_CMakeLists.txt filesJoerg Bornemann2021-01-123-220/+0
| | | | | | | | | | Those serve no purpose anymore, now that the .pro files are gone. Task-number: QTBUG-88742 Change-Id: I39943327b8c9871785b58e9973e4e7602371793e Reviewed-by: Cristian Adam <cristian.adam@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Kai Koehne <kai.koehne@qt.io>
* Remove the qmake project filesJoerg Bornemann2021-01-075-51/+0
| | | | | | | | | | | | | | | | Remove the qmake project files for most of Qt. Leave the qmake project files for examples, because we still test those in the CI to ensure qmake does not regress. Also leave the qmake project files for utils and other minor parts that lack CMake project files. Task-number: QTBUG-88742 Change-Id: I6cdf059e6204816f617f9624f3ea9822703f73cc Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Kai Koehne <kai.koehne@qt.io>
* Update shared-mime-info to the 2.1 release, adjust implementationDavid Faure2021-01-051-11/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* Replace QtTest headers with QTestDavid Skoland2020-12-223-3/+6
| | | | | | | | | | | Complete search and replace of QtTest and QtTest/QtTest with QTest, as QtTest includes the whole module. Replace all such instances with correct header includes. See Jira task for more discussion. Fixes: QTBUG-88831 Change-Id: I981cfae18a1cabcabcabee376016b086d9d01f44 Pick-to: 6.0 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* CMake: Regenerate projects using pro2cmake one last timeAlexandru Croitor2020-12-102-4/+4
| | | | | | | | | And fix up some wrong qmake project files Pick-to: 6.0 Change-Id: I66cb82aeb9c1419a74df1a650fa78a511ade7443 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* CMake: Regenerate projects to use new qt_internal_ APIAlexandru Croitor2020-09-235-19/+19
| | | | | | | | | | | Modify special case locations to use the new API as well. Clean up some stale .prev files that are not needed anymore. Clean up some project files that are not used anymore. Task-number: QTBUG-86815 Change-Id: I9947da921f98686023c6bb053dfcc101851276b5 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* QMimeDatabase: fix handling of glob-deleteallDavid Faure2020-09-221-2/+7
| | | | | | | | | | | | | | | | 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 Pick-to: 5.15 Change-Id: I9a4523f37cd962c730df9a6ed992bd01c075bf03 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Fix warnings about unused expression results in testsTor Arne Vestbø2020-07-291-8/+8
| | | | | Change-Id: I401ec8a3742a5bb51a1b8b291c53395c3880117c Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* CMake: Regenerate subdir test projectsAlexandru Croitor2020-07-093-15/+11
| | | | | | | | And generate a few more test projects that were missing. Change-Id: I5df51106549aa5ae09bc3c42360e14b143719547 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>