mirror of
https://github.com/tnodir/fort
synced 2024-11-15 07:06:08 +00:00
UI: Fix some clang warnings.
This commit is contained in:
parent
373590e09c
commit
9e68ff2034
@ -8,7 +8,7 @@ AppGroup::AppGroup(QObject *parent) :
|
||||
|
||||
void AppGroup::setEnabled(bool enabled)
|
||||
{
|
||||
if ((bool) m_enabled != enabled) {
|
||||
if (bool(m_enabled) != enabled) {
|
||||
m_enabled = enabled;
|
||||
emit enabledChanged();
|
||||
}
|
||||
@ -42,7 +42,6 @@ QVariant AppGroup::toVariant() const
|
||||
{
|
||||
QVariantMap map;
|
||||
|
||||
//map["enabled"] = enabled();
|
||||
map["name"] = name();
|
||||
map["blockText"] = blockText();
|
||||
map["allowText"] = allowText();
|
||||
@ -54,7 +53,6 @@ void AppGroup::fromVariant(const QVariant &v)
|
||||
{
|
||||
const QVariantMap map = v.toMap();
|
||||
|
||||
//m_enabled = map["enabled"].toBool();
|
||||
m_name = map["name"].toString();
|
||||
m_blockText = map["blockText"].toString();
|
||||
m_allowText = map["allowText"].toString();
|
||||
|
@ -3,8 +3,8 @@
|
||||
#include "../util/dateutil.h"
|
||||
#include "../util/fileutil.h"
|
||||
#include "databasesql.h"
|
||||
#include "sqlite/sqliteengine.h"
|
||||
#include "sqlite/sqlitedb.h"
|
||||
#include "sqlite/sqliteengine.h"
|
||||
#include "sqlite/sqlitestmt.h"
|
||||
|
||||
DatabaseManager::DatabaseManager(const QString &filePath,
|
||||
@ -21,7 +21,7 @@ DatabaseManager::DatabaseManager(const QString &filePath,
|
||||
|
||||
DatabaseManager::~DatabaseManager()
|
||||
{
|
||||
qDeleteAll(m_sqliteStmts.values());
|
||||
qDeleteAll(m_sqliteStmts);
|
||||
|
||||
delete m_sqliteDb;
|
||||
|
||||
|
@ -2,8 +2,8 @@
|
||||
|
||||
#include <QThreadPool>
|
||||
|
||||
#include "../fortcommon.h"
|
||||
#include "../conf/firewallconf.h"
|
||||
#include "../fortcommon.h"
|
||||
#include "../log/logbuffer.h"
|
||||
#include "../util/confutil.h"
|
||||
#include "../util/device.h"
|
||||
@ -93,7 +93,7 @@ bool DriverManager::writeConfFlags(const FirewallConf &conf)
|
||||
buf, flagsSize);
|
||||
}
|
||||
|
||||
bool DriverManager::writeData(int code, QByteArray &buf, int size)
|
||||
bool DriverManager::writeData(quint32 code, QByteArray &buf, int size)
|
||||
{
|
||||
m_driverWorker->cancelAsyncIo();
|
||||
|
||||
|
@ -38,7 +38,7 @@ private:
|
||||
void setupWorker();
|
||||
void abortWorker();
|
||||
|
||||
bool writeData(int code, QByteArray &buf, int size);
|
||||
bool writeData(quint32 code, QByteArray &buf, int size);
|
||||
|
||||
private:
|
||||
Device *m_device;
|
||||
|
@ -38,7 +38,7 @@ quint32 FortCommon::ioctlGetLog()
|
||||
return FORT_IOCTL_GETLOG;
|
||||
}
|
||||
|
||||
quint32 FortCommon::bufferSize()
|
||||
int FortCommon::bufferSize()
|
||||
{
|
||||
return FORT_BUFFER_SIZE;
|
||||
}
|
||||
|
@ -17,7 +17,7 @@ public:
|
||||
static quint32 ioctlSetFlags();
|
||||
static quint32 ioctlGetLog();
|
||||
|
||||
static quint32 bufferSize();
|
||||
static int bufferSize();
|
||||
|
||||
static quint32 logBlockedHeaderSize();
|
||||
static quint32 logBlockedSize(quint32 pathLen);
|
||||
|
@ -18,11 +18,11 @@ public:
|
||||
|
||||
void addLogEntry(const LogEntryBlocked &logEntry);
|
||||
|
||||
Q_INVOKABLE IpListModel *ipListModel(const QString &appPath) const;
|
||||
|
||||
signals:
|
||||
|
||||
public slots:
|
||||
IpListModel *ipListModel(const QString &appPath) const;
|
||||
|
||||
void clear() override;
|
||||
|
||||
private:
|
||||
|
@ -16,6 +16,9 @@ public:
|
||||
|
||||
void initialize();
|
||||
|
||||
Q_INVOKABLE TrafListModel *trafListModel(TrafListModel::TrafType type,
|
||||
const QString &appPath) const;
|
||||
|
||||
void handleProcNew(const QString &appPath);
|
||||
void handleStatTraf(quint16 procCount, const quint8 *procBits,
|
||||
const quint32 *trafBytes);
|
||||
@ -23,9 +26,6 @@ public:
|
||||
signals:
|
||||
|
||||
public slots:
|
||||
TrafListModel *trafListModel(TrafListModel::TrafType type,
|
||||
const QString &appPath) const;
|
||||
|
||||
void clear() override;
|
||||
|
||||
private:
|
||||
|
@ -53,7 +53,7 @@ void StringListModel::replace(const QString &text, int row)
|
||||
|
||||
const QModelIndex modelIndex = index(row);
|
||||
|
||||
dataChanged(modelIndex, modelIndex);
|
||||
emit dataChanged(modelIndex, modelIndex);
|
||||
}
|
||||
|
||||
void StringListModel::clear()
|
||||
|
@ -1,8 +1,8 @@
|
||||
#ifndef TASKINFO_H
|
||||
#define TASKINFO_H
|
||||
|
||||
#include <QObject>
|
||||
#include <QDateTime>
|
||||
#include <QObject>
|
||||
|
||||
QT_FORWARD_DECLARE_CLASS(TaskWorker)
|
||||
|
||||
|
@ -50,7 +50,7 @@ bool Device::cancelIo()
|
||||
return CancelIoEx(m_handle, NULL);
|
||||
}
|
||||
|
||||
bool Device::ioctl(int code, char *in, int inSize,
|
||||
bool Device::ioctl(quint32 code, char *in, int inSize,
|
||||
char *out, int outSize,
|
||||
int *retSize)
|
||||
{
|
||||
|
@ -21,7 +21,7 @@ public slots:
|
||||
|
||||
bool cancelIo();
|
||||
|
||||
bool ioctl(int code, char *in = nullptr, int inSize = 0,
|
||||
bool ioctl(quint32 code, char *in = nullptr, int inSize = 0,
|
||||
char *out = nullptr, int outSize = 0,
|
||||
int *retSize = nullptr);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user