Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions src/dsysinfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,14 @@
#include <QSettings>
#include <QStandardPaths>
#include <QDateTime>
#include <QRegularExpression>

Check warning on line 19 in src/dsysinfo.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

Include file: <QRegularExpression> not found. Please note: Cppcheck does not need standard library headers to get proper results.
#include <QLoggingCategory>

Check warning on line 20 in src/dsysinfo.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

Include file: <QLoggingCategory> not found. Please note: Cppcheck does not need standard library headers to get proper results.
#include <qmath.h>

Check warning on line 21 in src/dsysinfo.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

Include file: <qmath.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
#include <QMutex>

Check warning on line 22 in src/dsysinfo.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

Include file: <QMutex> not found. Please note: Cppcheck does not need standard library headers to get proper results.
#include <QMutexLocker>

Check warning on line 23 in src/dsysinfo.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

Include file: <QMutexLocker> not found. Please note: Cppcheck does not need standard library headers to get proper results.

#ifdef Q_OS_LINUX
#include <sys/sysinfo.h>

Check warning on line 26 in src/dsysinfo.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

Include file: <sys/sysinfo.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
#include <sys/utsname.h>
#include <unistd.h>
#endif
Expand Down Expand Up @@ -49,6 +51,8 @@
public:
DSysInfoPrivate();

mutable QMutex mutex;

#ifdef Q_OS_LINUX
void ensureDeepinInfo();
bool ensureOsVersion();
Expand Down Expand Up @@ -167,6 +171,7 @@

void DSysInfoPrivate::ensureDeepinInfo()
{
QMutexLocker locker(&mutex);
if (static_cast<int>(deepinType) > 0 && !inTest())
return;

Expand Down Expand Up @@ -246,8 +251,11 @@

bool DSysInfoPrivate::ensureOsVersion()
{
QMutexLocker locker(&mutex);
#ifndef OS_VERSION_TEST_FILE // Always re-read the file when testing
if (osBuild.A > 0 && !inTest())
return true;
#endif

DDesktopEntry entry(OS_VERSION_FILE);
bool ok = false;
Expand Down Expand Up @@ -447,6 +455,7 @@

void DSysInfoPrivate::ensureReleaseInfo()
{
QMutexLocker locker(&mutex);
if (productType > 0 && !inTest()) {
return;
}
Expand Down