forked from qt-creator/qt-creator
Plugins: Fix that mimetype definition was not valid JSON
JSON officially does not support multiline strings, so we should use the same mechanism that we already use for the plugin description (i.e. additionally support arrays of strings which are interpreted as lines). This just happens to work because Qt's JSON parser eats it without choking. Change-Id: I25ef04600b209775c5a7af916c687fda4a8b1a4d Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io> Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
@@ -131,8 +131,9 @@ bool CorePlugin::initialize(const QStringList &arguments, QString *errorMessage)
|
||||
continue;
|
||||
const QJsonObject metaData = plugin->metaData();
|
||||
const QJsonValue mimetypes = metaData.value("Mimetypes");
|
||||
if (mimetypes.isString())
|
||||
Utils::addMimeTypes(plugin->name() + ".mimetypes", mimetypes.toString().trimmed().toUtf8());
|
||||
QString mimetypeString;
|
||||
if (ExtensionSystem::PluginSpec::readMultiLineString(mimetypes, &mimetypeString))
|
||||
Utils::addMimeTypes(plugin->name() + ".mimetypes", mimetypeString.trimmed().toUtf8());
|
||||
}
|
||||
|
||||
if (ThemeEntry::availableThemes().isEmpty()) {
|
||||
|
||||
Reference in New Issue
Block a user