MCPcopy Create free account
hub / github.com/FreesmTeam/FreesmLauncher / _extract_version

Method _extract_version

libraries/systeminfo/src/distroutils.cpp:196–211  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

194}
195
196QString Sys::_extract_version(const QString& x)
197{
198 QRegularExpression versionish_string(QRegularExpression::anchoredPattern("\\d+(?:\\.\\d+)*$"));
199#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0)
200 QStringList list = x.split(QRegularExpression("\\s+"), Qt::SkipEmptyParts);
201#else
202 QStringList list = x.split(QRegularExpression("\\s+"), QString::SkipEmptyParts);
203#endif
204 for (int i = list.size() - 1; i >= 0; --i) {
205 QString chunk = list[i];
206 if (versionish_string.match(chunk).hasMatch()) {
207 return chunk;
208 }
209 }
210 return QString();
211}
212
213Sys::DistributionInfo Sys::read_legacy_release()
214{

Callers

nothing calls this directly

Calls 2

QStringClass · 0.85
sizeMethod · 0.45

Tested by

no test coverage detected