fix all PIFile::readAll calls

This commit is contained in:
2025-09-05 21:50:35 +03:00
parent 3d7ba1dee6
commit c05b8b4095
2 changed files with 9 additions and 9 deletions

View File

@@ -212,7 +212,7 @@ void PISystemMonitor::run() {
// piCout << (PRIVATE->cpu_u_cur - PRIVATE->cpu_u_prev).toMilliseconds() / delay_ms; // piCout << (PRIVATE->cpu_u_cur - PRIVATE->cpu_u_prev).toMilliseconds() / delay_ms;
# else # else
PRIVATE->file.seekToBegin(); PRIVATE->file.seekToBegin();
PIString str = PIString::fromAscii(PRIVATE->file.readAll(true)); PIString str = PIString::fromAscii(PRIVATE->file.readAll());
int si = str.find('(') + 1, fi = 0, cc = 1; int si = str.find('(') + 1, fi = 0, cc = 1;
for (int i = si; i < str.size_s(); ++i) { for (int i = si; i < str.size_s(); ++i) {
if (str[i] == '(') cc++; if (str[i] == '(') cc++;
@@ -250,7 +250,7 @@ void PISystemMonitor::run() {
// piCout << sl[0] << sl[12] << sl[13]; // piCout << sl[0] << sl[12] << sl[13];
PRIVATE->filem.seekToBegin(); PRIVATE->filem.seekToBegin();
str = PIString::fromAscii(PRIVATE->filem.readAll(true)); str = PIString::fromAscii(PRIVATE->filem.readAll());
sl = str.split(" "); sl = str.split(" ");
if (sl.size_s() < 6) return; if (sl.size_s() < 6) return;
tstat.virtual_memsize = sl[0].toLong() * page_size; tstat.virtual_memsize = sl[0].toLong() * page_size;
@@ -357,7 +357,7 @@ void PISystemMonitor::gatherThread(llong id) {
PIFile f(PRIVATE->proc_dir + "task/" + PIString::fromNumber(id) + "/stat"); PIFile f(PRIVATE->proc_dir + "task/" + PIString::fromNumber(id) + "/stat");
// piCout << f.path(); // piCout << f.path();
if (!f.open(PIIODevice::ReadOnly)) return; if (!f.open(PIIODevice::ReadOnly)) return;
PIString str = PIString::fromAscii(f.readAll(true)); PIString str = PIString::fromAscii(f.readAll());
int si = str.find('(') + 1, fi = 0, cc = 1; int si = str.find('(') + 1, fi = 0, cc = 1;
for (int i = si; i < str.size_s(); ++i) { for (int i = si; i < str.size_s(); ++i) {
if (str[i] == '(') cc++; if (str[i] == '(') cc++;

View File

@@ -1208,7 +1208,7 @@ PIVector<PISerial::DeviceInfo> PISerial::availableDevicesInfo(bool test) {
# endif # endif
PIFile file_prefixes("/proc/tty/drivers", PIIODevice::ReadOnly); PIFile file_prefixes("/proc/tty/drivers", PIIODevice::ReadOnly);
if (file_prefixes.open()) { if (file_prefixes.open()) {
PIString fc = PIString::fromAscii(file_prefixes.readAll(true)), line, cpref; PIString fc = PIString::fromAscii(file_prefixes.readAll()), line, cpref;
PIStringList words; PIStringList words;
file_prefixes.close(); file_prefixes.close();
while (!fc.isEmpty()) { while (!fc.isEmpty()) {