MCPcopy Create free account
hub / github.com/KDE/labplot / setVersion

Method setVersion

src/backend/core/Project.cpp:116–145  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

114 }
115
116 bool setVersion(const QString& v) const {
117 versionString = v;
118 auto l = v.split(QLatin1Char('.'));
119 const int count = l.count();
120 int major = 0;
121 int minor = 0;
122 int patch = 0;
123 bool ok;
124
125 if (count > 0) {
126 major = l.at(0).toInt(&ok);
127 if (!ok)
128 return false;
129 }
130
131 if (count > 1) {
132 minor = l.at(1).toInt(&ok);
133 if (!ok)
134 return false;
135 }
136
137 if (count > 2) {
138 patch = l.at(2).toInt(&ok);
139 if (!ok)
140 return false;
141 }
142
143 m_versionNumber = QT_VERSION_CHECK(major, minor, patch);
144 return true;
145 }
146
147 static QString version() {
148 return versionString;

Callers 2

saveMethod · 0.80
loadMethod · 0.80

Calls 2

splitMethod · 0.80
countMethod · 0.45

Tested by

no test coverage detected