From 3dcd51ef8d644123b6bb7faa105081e76260b3bc Mon Sep 17 00:00:00 2001 From: Alexandre Quessy Date: Wed, 30 Apr 2014 22:28:41 -0400 Subject: [PATCH] XML file version is now 0.1 --- HACKING | 7 +++++++ ProjectReader.cpp | 6 ++++-- ProjectWriter.cpp | 2 +- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/HACKING b/HACKING index 1b50596..e4c36c6 100644 --- a/HACKING +++ b/HACKING @@ -30,3 +30,10 @@ Files * images/: Images part of the GUI. * prototypes/ : Contains prototypes. Please ask the project maintainer before removing some of these. +XML file version number +----------------------- +* update its minor number when you introduce new features. +* update its major number when it's not backward-comptatible anymore with its previous versions +* generally, we should follow the MapMap version, when new changes are introduced. (no need to increment it otherwise) +* we will need to implement some fancy XML file version number checking in the future. + diff --git a/ProjectReader.cpp b/ProjectReader.cpp index 830f645..cd5d982 100644 --- a/ProjectReader.cpp +++ b/ProjectReader.cpp @@ -41,8 +41,10 @@ bool ProjectReader::readFile(QIODevice *device) } QDomElement root = doc.documentElement(); - if (root.tagName() != "project" || root.attribute("version") != "1.0") { - _xml.raiseError(QObject::tr("The file is not a mapmap version 1.0 file.")); + // The handling of the version number will get fancier as we go. + if (root.tagName() != "project" || root.attribute("version") != "0.1") + { + _xml.raiseError(QObject::tr("The file is not a mapmap version 0.1 file.")); return false; } diff --git a/ProjectWriter.cpp b/ProjectWriter.cpp index 7ea9b4a..5c4bd3d 100644 --- a/ProjectWriter.cpp +++ b/ProjectWriter.cpp @@ -33,7 +33,7 @@ bool ProjectWriter::writeFile(QIODevice *device) _xml.writeStartDocument(); _xml.writeDTD(""); _xml.writeStartElement("project"); - _xml.writeAttribute("version", "1.0"); + _xml.writeAttribute("version", "0.1"); // Similar to pkg-config version numbers. _xml.writeStartElement("paints"); for (int i = 0; i < _manager->nPaints(); i++)