summaryrefslogtreecommitdiffstats
path: root/src/corelib/mimetypes
diff options
context:
space:
mode:
authorCristian Maureira-Fredes <cristian.maureira-fredes@qt.io>2018-09-03 14:02:13 +0200
committerCristian Maureira-Fredes <cristian.maureira-fredes@qt.io>2018-10-15 10:55:18 +0000
commit1f6bfc220774e9407fe88916843b76ed103cff72 (patch)
tree8d6157d5b974e6045d75a716f8eb0db4daefa35f /src/corelib/mimetypes
parent02a214442781bf112c1cc85d2470c6fcec8ed207 (diff)
Doc: Move literal code block to a separate file
We need to override this snippet for the documentation we generate for Qt for Python, and it is easier to have it on a separate file. Task-number: PYSIDE-801 Task-number: PYSIDE-691 Change-Id: Ideb5b6af25024279f167137d3b65660bb9c96a7e Reviewed-by: Topi Reiniƶ <topi.reinio@qt.io>
Diffstat (limited to 'src/corelib/mimetypes')
-rw-r--r--src/corelib/mimetypes/qmimedatabase.cpp15
1 files changed, 2 insertions, 13 deletions
diff --git a/src/corelib/mimetypes/qmimedatabase.cpp b/src/corelib/mimetypes/qmimedatabase.cpp
index 10b5c8eafd..35ea579767 100644
--- a/src/corelib/mimetypes/qmimedatabase.cpp
+++ b/src/corelib/mimetypes/qmimedatabase.cpp
@@ -453,25 +453,14 @@ bool QMimeDatabasePrivate::inherits(const QString &mime, const QString &parent)
Applications which want to define custom MIME types need to install an
XML file into the locations searched for MIME definitions.
These locations can be queried with
- \code
- QStandardPaths::locateAll(QStandardPaths::GenericDataLocation, QLatin1String("mime/packages"),
- QStandardPaths::LocateDirectory);
- \endcode
+ \snippet code/src_corelib_mimetype_qmimedatabase.cpp 1
On a typical Unix system, this will be /usr/share/mime/packages/, but it is also
possible to extend the list of directories by setting the environment variable
\c XDG_DATA_DIRS. For instance adding /opt/myapp/share to \c XDG_DATA_DIRS will result
in /opt/myapp/share/mime/packages/ being searched for MIME definitions.
Here is an example of MIME XML:
- \code
- <?xml version="1.0" encoding="UTF-8"?>
- <mime-info xmlns="http://www.freedesktop.org/standards/shared-mime-info">
- <mime-type type="application/vnd.qt.qmakeprofile">
- <comment xml:lang="en">Qt qmake Profile</comment>
- <glob pattern="*.pro" weight="50"/>
- </mime-type>
- </mime-info>
- \endcode
+ \snippet code/src_corelib_mimetype_qmimedatabase.cpp 2
For more details about the syntax of XML MIME definitions, including defining
"magic" in order to detect MIME types based on data as well, read the