Commit a54a4c41 authored by Frederik Gladhorn's avatar Frederik Gladhorn

Make sure not to add empty mime types when importing/exporting

When building with assertions this crashes since empty strings are not
accepted. The native kra import/export plugins only have one of the
types set though, so they would add an empty mime for the opposite
direction (import vs export).
parent a9316ac1
......@@ -234,7 +234,9 @@ QStringList KisImportExportManager::mimeFilter(Direction direction)
Q_FOREACH(QPluginLoader *loader, list) {
QJsonObject json = loader->metaData().value("MetaData").toObject();
Q_FOREACH(const QString &mimetype, json.value("X-KDE-Import").toString().split(",")) {
mimeTypes << mimetype;
if (!mimetype.isEmpty()) {
mimeTypes << mimetype;
}
}
}
qDeleteAll(list);
......@@ -249,7 +251,9 @@ QStringList KisImportExportManager::mimeFilter(Direction direction)
Q_FOREACH(QPluginLoader *loader, list) {
QJsonObject json = loader->metaData().value("MetaData").toObject();
Q_FOREACH(const QString &mimetype, json.value("X-KDE-Export").toString().split(",")) {
mimeTypes << mimetype;
if (!mimetype.isEmpty()) {
mimeTypes << mimetype;
}
}
}
qDeleteAll(list);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment