summaryrefslogtreecommitdiffstats
path: root/src/corelib/mimetypes/qmimetypeparser_p.h
diff options
context:
space:
mode:
authorDavid Faure <david.faure@kdab.com>2015-08-25 14:30:07 +0200
committerDavid Faure <david.faure@kdab.com>2015-09-04 20:00:22 +0000
commit5e41f4137dd42a9a639be8743ae95c8e159bd4e0 (patch)
tree458a432ed04ddd9556a97358c2bbf9212fecbf57 /src/corelib/mimetypes/qmimetypeparser_p.h
parent880a8aa7e99bb91e7a815cadde72bb5230c815ea (diff)
QMimeDatabase: warn instead of asserting on bad magic.
An invalid mime magic definition could lead to an assert. Replaced with a qWarning. Move all checking to the QMimeMagicRule constructor, and do keep invalid rules since they are need to parse child rules. Unit test added, with QTest::ignoreMessage when using the XML backend (there's no warning from update-mime-database when using the cache). Also make it easier to add more shared mime info files for tests. Task-number: QTBUG-44319 Done-with: Eike Ziller <eike.ziller@theqtcompany.com> Change-Id: Ie39a160a106b650cdcee88778fa7eff9e932a988 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/mimetypes/qmimetypeparser_p.h')
-rw-r--r--src/corelib/mimetypes/qmimetypeparser_p.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/corelib/mimetypes/qmimetypeparser_p.h b/src/corelib/mimetypes/qmimetypeparser_p.h
index 2be4380cee..3a2e6b8a14 100644
--- a/src/corelib/mimetypes/qmimetypeparser_p.h
+++ b/src/corelib/mimetypes/qmimetypeparser_p.h
@@ -66,6 +66,8 @@ public:
bool parse(QIODevice *dev, const QString &fileName, QString *errorMessage);
+ static bool parseNumber(const QString &n, int *target, QString *errorMessage);
+
protected:
virtual bool process(const QMimeType &t, QString *errorMessage) = 0;
virtual bool process(const QMimeGlobPattern &t, QString *errorMessage) = 0;