summaryrefslogtreecommitdiffstats
path: root/src/corelib/mimetypes/qmimeprovider.cpp
Commit message (Collapse)AuthorAgeFilesLines
* QtCore: eradicate all Q_FOREACH loops [mimetypes]Marc Mutz2016-01-041-12/+12
| | | | | | | | | Saves just shy of 6KiB in text size on optimized GCC 4.9 Linux AMD64 builds, iow: ~0.1% of the total QtCore library size. Change-Id: I087e1e34a64944affb1211e16371e314012c4b2c Reviewed-by: David Faure <david.faure@kdab.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QtBase: combine adjacent qDebug()/qCritical() linesMarc Mutz2015-11-281-3/+3
| | | | | | | | | For qDebug() and qWarning(), this is just an optimization. For qCritical(), which can be fatal, the old code was just wrong. Change-Id: I6d8ab1d7531d766cd41b49569dc0fd4420ecab8b Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* QtBase: remove explicit function info from qWarning() etcMarc Mutz2015-11-281-1/+1
| | | | | | | | | | | This information is already registered by the QMessageLogger ctor. Where, by dropping the << Q_FUNC_INFO in ostream-style qDebug(), only a string literal remained, converted to printf-style qDebug() on the go. Change-Id: I3f261c98fd7bcfa1fead381a75a82713bb75e6f3 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* Replace backwards Java-style iteration with new reverse_iteratorsMarc Mutz2015-11-191-5/+2
| | | | | | | | Faster, and, thanks to the new reverse_iterators, just as convenient. Change-Id: Ibc6c64051a8ede4a47428e9271ffbeaa921fc255 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> Reviewed-by: David Faure <david.faure@kdab.com>
* QMimeBinaryProvider::loadMimeTypePrivate(): avoid an unneeded QStringRef -> ↵Marc Mutz2015-10-191-1/+1
| | | | | | | | QString conversion Change-Id: Id6baae4b710fd9aa8bdc4721dbe64e2d881163bb Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* Merge remote-tracking branch 'origin/5.5' into 5.6Liang Qi2015-10-021-0/+1
|\ | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: qmake/doc/src/qmake-manual.qdoc src/corelib/tools/qstring.h src/gui/image/qimagereader.cpp src/network/access/qnetworkaccessmanager.cpp src/tools/qdoc/doc/examples/examples.qdoc src/widgets/accessible/qaccessiblewidgetfactory_p.h src/widgets/doc/qtwidgets.qdocconf Change-Id: I8fae62283aebefe24e5ca4b4abd97386560c0fcb
| * QMimeType: add KDAB copyright to the code I contributed a lot to.David Faure2015-09-041-0/+1
| | | | | | | | | | Change-Id: I794259f28c7adbaad3cfb40f92a0ad2dc512e5b4 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Merge remote-tracking branch 'origin/5.5' into 5.6Liang Qi2015-08-261-7/+9
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: qmake/doc/snippets/code/doc_src_qmake-manual.pro qmake/doc/src/qmake-manual.qdoc src/corelib/io/qstorageinfo_unix.cpp src/corelib/tools/qbytearray.cpp src/widgets/kernel/qwidgetwindow.cpp tests/auto/corelib/io/qprocess/tst_qprocess.cpp tests/auto/corelib/mimetypes/qmimedatabase/tst_qmimedatabase.cpp tests/auto/network/access/qnetworkreply/BLACKLIST Change-Id: I9efcd7e1cce1c394eed425c43aa6fce7d2edf31c
| * QMimeDatabase: adapt to changes in shared-mime-info 1.3David Faure2015-08-161-3/+6
| | | | | | | | | | | | | | | | | | The generated xml file is now lowercase. This was changed in shared-mime-info 3805d0bcf2. It led to runtime warnings "No file found for ...", which helped notice the bug. Change-Id: I31f0fc7f0fe8a098c3f79c0bcbeeb1909d2cc05a Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| * QMimeProvider: Do not crash when globPatterns is empty.Milian Wolff2015-08-121-1/+1
| | | | | | | | | | Change-Id: I351a533a1f03ac2e7bdec876b657a80fac60b2ed Reviewed-by: Milian Wolff <milian.wolff@kdab.com>
| * QMimeDatabase: use QElapsedTimer instead of QDateTime::currentDateTime()David Faure2015-08-121-3/+2
| | | | | | | | | | | | | | | | This reduces the number of syscalls greatly, by avoiding the timezone conversion every time. Change-Id: I39a54def4b45f25c6e037ced6943b05ddc749c9d Reviewed-by: Milian Wolff <milian.wolff@kdab.com>
* | core: Add several QList::reserve() calls.Sérgio Martins2015-06-111-0/+1
|/ | | | | | | Reduces reallocations. Change-Id: Ib63539fb690a80245d8fe81ff8468e79ffa8e57c Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* Introduce QT_NO_MIMETYPESérgio Martins2015-02-171-0/+4
| | | | | | | | | | | | | The mime type stuff generates one of the biggest translation units in QtCore due to the compressed 1.7MB freedesktop.org.xml resource. With QT_NO_MIMETYPE, libQt5Core.so is almost 400Kb smaller (4.8MB->4.4MB gcc 4.9 stripped release build) Change-Id: I5339090994034355724ff4deddb64720e81baeaf Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com> Reviewed-by: David Faure <david.faure@kdab.com> Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* Update copyright headersJani Heikkinen2015-02-111-7/+7
| | | | | | | | | | | | | | | | | | Qt copyrights are now in The Qt Company, so we could update the source code headers accordingly. In the same go we should also fix the links to point to qt.io. Outdated header.LGPL removed (use header.LGPL21 instead) Old header.LGPL3 renamed to header.LGPL3-COMM to match actual licensing combination. New header.LGPL-COMM taken in the use file which were using old header.LGPL3 (src/plugins/platforms/android/extract.cpp) Added new header.LGPL3 containing Commercial + LGPLv3 + GPLv2 license combination Change-Id: I6f49b819a8a20cc4f88b794a8f6726d975e8ffbe Reviewed-by: Matti Paaso <matti.paaso@theqtcompany.com>
* Update license headers and add new license filesMatti Paaso2014-09-241-19/+11
| | | | | | | | | - Renamed LICENSE.LGPL to LICENSE.LGPLv21 - Added LICENSE.LGPLv3 - Removed LICENSE.GPL Change-Id: Iec3406e3eb3f133be549092015cefe33d259a3f2 Reviewed-by: Iikka Eklund <iikka.eklund@digia.com>
* Add missing Q_INIT_RESOURCETor Arne Vestbø2013-11-071-0/+6
| | | | | | | | | | | The library needs to do Q_INIT_RESOURCE for all resources it uses internally, otherwise static linking will fail, and the user has no idea how to rectify it as the name of the missing resource is not known. The Q_INIT_RESOURCE needs to happen outside of any namespace, hence the use of static initResources() functions. Change-Id: I8f7d36b440b05809d97dd489cf8789f345633cec Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Update copyright year in Digia's license headersSergio Ahumada2013-01-181-1/+1
| | | | | Change-Id: Ic804938fc352291d011800d21e549c10acac66fb Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Add QMimeType::aliases().David Faure2012-11-221-0/+30
| | | | | | | | | Requested by Allan Sandfeld Jensen for QWebkit, which needs to register upfront all the mimetypes that a given plugin can handle. Change-Id: I64b8d39c7988adfc7db4ed8bfdc73acd16e999da Reviewed-by: Allan Sandfeld Jensen <allan.jensen@digia.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Change copyrights from Nokia to DigiaIikka Eklund2012-09-221-24/+24
| | | | | | | | Change copyrights and license headers from Nokia to Digia Change-Id: If1cc974286d29fd01ec6c19dd4719a67f4c3f00e Reviewed-by: Lars Knoll <lars.knoll@digia.com> Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
* add macro wrap for QXmlStream related codeJing Bai2012-08-311-0/+5
| | | | | | | | To fix a compile error when QXmlStream is removed by defining macro, but it is still used in some files. Change-Id: I776c799732212b7401767440448248fc7b5dc480 Reviewed-by: David Faure <faure@kde.org>
* QtCore: use new qEnvironmentVariableIs{Set,Empty}()Marc Mutz2012-08-141-1/+1
| | | | | | | | | | | | In particular, qEmergencyOut() is now completely exception-free. Incidentally, this patch shows that Qt isn't consistent in how it treats empty environment variables used as flags, but that is something for a separate commit. This patch aims to be behaviour-preserving, except in exceptional circumstances, of course. Change-Id: Ie106e7b430e1ab086c40c81cc1e56cd0e5400cb4 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QMimeType performance fix: don't reload from XML files over and over.David Faure2012-05-071-0/+3
| | | | | | | Change-Id: Ie19c338ed6449ea1509306cbda5dc251295783ae Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
* QMimeDatabase: Fix crash on empty filenameDavid Faure2012-03-061-0/+2
| | | | | | | | | This is due to the search in the suffix tree starting at position fileName.length() - 1. Change-Id: I98501c1724c7dde2626351ace8ba19faa0d2e1e1 Reviewed-by: Ivan Komissarov <ABBAPOH@nextmail.ru> Reviewed-by: Wolf-Michael Bolle <wolf-michael.bolle@nokia.com>
* Import QMimeType / QMimeDatabase into QtCore.David Faure2012-02-181-0/+830
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>