summaryrefslogtreecommitdiffstats
path: root/tests/auto/corelib/mimetypes
Commit message (Collapse)AuthorAgeFilesLines
* Rename QMimeDatabase method for consistency.David Faure2012-05-151-3/+3
| | | | | | | | Name is about mimetype names, while FileName is about, well, file names. Task-number: QTBUG-25748 Change-Id: I34a9ac1a5fc06dc3e3855365e19c4dc7a1aa2671 Reviewed-by: Wolf-Michael Bolle <wolf-michael.bolle@nokia.com>
* Make comment() work in the C locale too.David Faure2012-03-221-1/+1
| | | | | | | | | The parser makes the default language en_US, and no mimetype xml says <comment xml:lang="C">, so use the en_US string for the C locale, rather than returning an empty string. Change-Id: Iad7c142e8078abe357773249416e7ce9b3e29a92 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QMimeDatabase: Fix crash on empty filenameDavid Faure2012-03-061-0/+1
| | | | | | | | | 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>
* Add note about failing test when using shared-mime-info < 1.0David Faure2012-03-021-0/+3
| | | | | Change-Id: I3ba9d14d915a579b9e102114866f6c9e0344ba16 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
* Fix tests of QMimeDatabase.Friedemann Kleint2012-02-297-65/+121
| | | | | | | | | | | | | | | - Use temporary directories to avoid instabilities due to remains of previous failed tests and locked directories. - Replace SRCDIR by QFINDTESTDATA(), reference only the freedesktop.org.xml contained in the Qt source tree by $$QT.corelib.sources. - Improve some error messages, test suite instructions for Windows. Change-Id: Idee8e3767ef0a8299df3bdaaac20334164878db0 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com> Reviewed-by: David Faure <faure@kde.org>
* qmimetype: Fix test failure when LC_ALL is set.David Faure2012-02-211-0/+1
| | | | | | | | | | | | This code sets LANG=en_US so that the method comment(), which returns a translated name, can be compared with an expected result in English. (QMimeType::comment uses QLocale::system().name() and QLocale::system().uiLanguages()) But LANG= has no effect if LC_ALL is set, so LC_ALL needs to be cleared (or set to en_US) for the test to work. Change-Id: Icb031057769be9bc8c0fcab65daa45e7bf1d5b18 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Modify helper functions to remove embedded QSKIP call and return status.Toby Tomkins2012-02-201-8/+13
| | | | | | | | | The helper functions contained QSKIP macros which do not also skip their parent function. These QSKIP function were removed and replaced with a return success value. Change-Id: I533f57842fc95beaeb1fcde5235678e9807db056 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Import QMimeType / QMimeDatabase into QtCore.David Faure2012-02-1811-0/+1351
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>