logic: Reparse project of newer version

This commit is contained in:
Eberhard Graether
2016-03-14 14:52:40 +01:00
parent cefaeae1ab
commit 0dbdf9081e
3 changed files with 6 additions and 19 deletions
+1 -1
View File
@@ -30,7 +30,7 @@ bool SqliteStorage::init()
setup(); setup();
return false; return false;
} }
else if (version.isOlderStorageVersionThan(Version::getApplicationVersion())) else if (version.isDifferentStorageVersionThan(Version::getApplicationVersion()))
{ {
clear(); clear();
return false; return false;
+4 -17
View File
@@ -83,24 +83,11 @@ bool Version::operator<(const Version& other) const
} }
} }
bool Version::isOlderStorageVersionThan(const Version& other) const bool Version::isDifferentStorageVersionThan(const Version& other) const
{ {
if (m_majorNumber != other.m_majorNumber) return m_majorNumber != other.m_majorNumber ||
{ m_minorNumber != other.m_minorNumber ||
return m_majorNumber < other.m_majorNumber; m_refreshNumber != other.m_refreshNumber;
}
else if (m_minorNumber != other.m_minorNumber)
{
return m_minorNumber < other.m_minorNumber;
}
else if (m_refreshNumber != other.m_refreshNumber)
{
return m_refreshNumber < other.m_refreshNumber;
}
else
{
return false;
}
} }
std::string Version::toString() const std::string Version::toString() const
+1 -1
View File
@@ -15,7 +15,7 @@ public:
bool isEmpty() const; bool isEmpty() const;
bool operator<(const Version& other) const; bool operator<(const Version& other) const;
bool isOlderStorageVersionThan(const Version& other) const; bool isDifferentStorageVersionThan(const Version& other) const;
std::string toString() const; std::string toString() const;
std::string toDisplayString() const; std::string toDisplayString() const;