Changeset - 69502eaef6c8
[Not reviewed]
Hasan Yavuz Ă–ZDERYA - 8 years ago 2017-08-19 14:25:06
hy@ozderya.net
minor version is necessary to distinguish version numbers from other numbers such as architecture
1 file changed with 1 insertions and 1 deletions:
0 comments (0 inline, 0 general)
src/versionnumber.cpp
Show inline comments
 
@@ -33,13 +33,13 @@ QString VersionNumber::toString() const
 
    return QString("%1.%2.%3").arg(major).arg(minor).arg(patch);
 
}
 

	
 
bool VersionNumber::extract(const QString& str, VersionNumber& number)
 
{
 
    QRegularExpression regexp("(?:[-_vV \\t]|^)(?<major>\\d+)"
 
                              "(?:\\.(?<minor>\\d+))?(?:\\.(?<patch>\\d+))?[-_ \\t]?");
 
                              "(?:\\.(?<minor>\\d+))(?:\\.(?<patch>\\d+))?[-_ \\t]?");
 
    auto match = regexp.match(str, 0, QRegularExpression::PartialPreferCompleteMatch);
 

	
 
    if (!(match.hasMatch() || match.hasPartialMatch())) return false;
 

	
 
    number.major = match.captured("major").toUInt();
 

	
0 comments (0 inline, 0 general)