Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/app/ProjectOpeningContext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ ProjectOpeningContext::~ProjectOpeningContext() {
void ProjectOpeningContext::proceed() {
if (!m_reader.success()) {
deleteLater();
if (!m_reader.getVersion().isNull() && (m_reader.getVersion().toInt() != PROJECT_VERSION)) {
const int version = m_reader.getVersion().toInt();
if (!m_reader.getVersion().isNull() && (version < 3 || version > PROJECT_VERSION)) {
QMessageBox::warning(m_parent, tr("Error"),
tr("The project file is not compatible with the current application version."));
return;
Expand Down
5 changes: 4 additions & 1 deletion src/core/ProjectReader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,10 @@ ProjectReader::ProjectReader(const QDomDocument& doc, const QString& projectFile
QDomElement projectEl(m_doc.documentElement());

m_version = projectEl.attribute("version");
if (m_version.isNull() || (m_version.toInt() != PROJECT_VERSION)) {
// Version 3 projects (4lex4-era through v1.1.x) are readable as is:
// attributes added since then all have fallbacks in the readers.
const int version = m_version.toInt();
if (m_version.isNull() || version < 3 || version > PROJECT_VERSION) {
return;
}

Expand Down