mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2026-10-17 19:34:13 +02:00
Name the .qetz MIME type application/x-qet-project+zip
Every other QElectroTech file type is application/x-qet-*; the zipped project was application/x-qelectrotech-project+zip. No release has shipped it yet, so it is renamed now. Files written with the old name still open: the reader accepts both, and the shared-mime-info file keeps the old name as an alias and matches either on content. Review of #1472 (scorpio810, point 2). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -25,7 +25,8 @@
|
||||
#include <QRegularExpression>
|
||||
#include <QUuid>
|
||||
|
||||
const char QetContainer::MimeType[] = "application/x-qelectrotech-project+zip";
|
||||
const char QetContainer::MimeType[] = "application/x-qet-project+zip";
|
||||
const char QetContainer::OldMimeType[] = "application/x-qelectrotech-project+zip";
|
||||
|
||||
namespace {
|
||||
const QString PartTag = QStringLiteral("qetz-part");
|
||||
@@ -426,7 +427,8 @@ bool QetContainer::join(const QList<QetZip::Entry> &entries, QDomDocument *proje
|
||||
for (const QetZip::Entry &entry : entries)
|
||||
files.insert(entry.name, entry.data);
|
||||
|
||||
if (files.value(QStringLiteral("mimetype")) != QByteArray(MimeType)) {
|
||||
const QByteArray mimetype = files.value(QStringLiteral("mimetype"));
|
||||
if (mimetype != QByteArray(MimeType) && mimetype != QByteArray(OldMimeType)) {
|
||||
setError(error, QStringLiteral("not a QElectroTech project (.qetz)"));
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user