Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:epopov:branches:openSUSE:Factory
libksysguard6
2001-smaps.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 2001-smaps.patch of Package libksysguard6
diff --git a/formatter/Formatter.cpp b/formatter/Formatter.cpp index 104d218a038f03e18334cfe7df92343e44b3af92..989acadda97bec58a902e15da3ea7f215eddd3cb 100644 --- a/formatter/Formatter.cpp +++ b/formatter/Formatter.cpp @@ -458,6 +458,10 @@ QString Formatter::formatValue(const QVariant &value, Unit unit, MetricPrefix ta case UnitGigaByte: case UnitTeraByte: case UnitPetaByte: + if (value.toDouble() < 0) { + return i18nc("Not available", "N/A"); + } + Q_FALLTHROUGH(); case UnitByteRate: case UnitKiloByteRate: case UnitMegaByteRate: diff --git a/processcore/read_procsmaps_runnable.cpp b/processcore/read_procsmaps_runnable.cpp index 29458cf7120e5549d297c315f4ba95591fe5fcf9..68500c9694708b0329d2902ca44763eb6e7c2e91 100644 --- a/processcore/read_procsmaps_runnable.cpp +++ b/processcore/read_procsmaps_runnable.cpp @@ -19,20 +19,19 @@ ReadProcSmapsRunnable::ReadProcSmapsRunnable(const QString &dir) void ReadProcSmapsRunnable::run() { - QFile file{m_dir + QStringLiteral("smaps_rollup")}; - if (!file.open(QIODevice::ReadOnly)) { - return; - } + qlonglong pss = -1; - qulonglong pss = 0LL; - auto buffer = QByteArray{1024, '\0'}; - while (file.readLine(buffer.data(), buffer.size()) > 0) { - if (buffer.startsWith("Pss:")) { - pss += std::stoll(buffer.mid(sizeof("Pss:")).toStdString()); + QFile file{m_dir + QStringLiteral("smaps_rollup")}; + if (file.open(QIODevice::ReadOnly)) { + auto buffer = QByteArray{1024, '\0'}; + while (file.readLine(buffer.data(), buffer.size()) > 0) { + if (buffer.startsWith("Pss:")) { + pss += std::stoll(buffer.mid(sizeof("Pss:")).toStdString()); + break; + } } + file.close(); } - file.close(); - Q_EMIT finished(pss); }
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor