UI: Fix some clang warnings.

This commit is contained in:
Nodir Temirkhodjaev 2017-12-06 18:41:26 +05:00
parent 373590e09c
commit 9e68ff2034
12 changed files with 17 additions and 19 deletions

View File

@ -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();

View File

@ -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;

View File

@ -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();

View File

@ -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;

View File

@ -38,7 +38,7 @@ quint32 FortCommon::ioctlGetLog()
return FORT_IOCTL_GETLOG;
}
quint32 FortCommon::bufferSize()
int FortCommon::bufferSize()
{
return FORT_BUFFER_SIZE;
}

View File

@ -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);

View File

@ -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:

View File

@ -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:

View File

@ -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()

View File

@ -1,8 +1,8 @@
#ifndef TASKINFO_H
#define TASKINFO_H
#include <QObject>
#include <QDateTime>
#include <QObject>
QT_FORWARD_DECLARE_CLASS(TaskWorker)

View File

@ -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)
{

View File

@ -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);