few fixes from LGTM

old-commit-hash: 758794dec5a886a8c3704d9e2ac191f8c208cc7e
This commit is contained in:
Adeeb Shihadeh
2021-01-16 14:23:06 -08:00
parent b5efa28b59
commit 6a01983000
4 changed files with 16 additions and 8 deletions
+4
View File
@@ -74,6 +74,10 @@ LogReader::LogReader(const QString& file, Events *events_, QReadWriteLock* event
});
}
LogReader::~LogReader() {
delete parser;
}
void LogReader::mergeEvents(int dled) {
auto amsg = kj::arrayPtr((const capnp::word*)(raw.data() + event_offset), (dled-event_offset)/sizeof(capnp::word));
Events events_local;
+9 -6
View File
@@ -1,5 +1,4 @@
#ifndef FILEREADER_HPP
#define FILEREADER_HPP
#pragma once
#include <QString>
#include <QNetworkAccessManager>
@@ -20,7 +19,8 @@
#include "channel.hpp"
class FileReader : public QObject {
Q_OBJECT
Q_OBJECT
public:
FileReader(const QString& file_);
void startRequest(const QUrl &url);
@@ -28,10 +28,13 @@ public:
virtual void readyRead();
void httpFinished();
virtual void done() {};
public slots:
void process();
protected:
QNetworkReply *reply;
private:
QNetworkAccessManager *qnam;
QElapsedTimer timer;
@@ -44,9 +47,12 @@ class LogReader : public FileReader {
Q_OBJECT
public:
LogReader(const QString& file, Events *, QReadWriteLock* events_lock_, QMap<int, QPair<int, int> > *eidx_);
~LogReader();
void readyRead();
void done() { is_done = true; };
bool is_done = false;
private:
bz_stream bStream;
@@ -63,6 +69,3 @@ private:
QReadWriteLock* events_lock;
QMap<int, QPair<int, int> > *eidx;
};
#endif