Fixed most issues from codacy (#3050)

This commit is contained in:
ctrlaltca 2018-01-27 19:31:44 +01:00 committed by Zach H
parent 3c3e6ae68a
commit e127cb74b6
16 changed files with 26 additions and 33 deletions

View file

@ -37,7 +37,7 @@ private:
int flags;
public:
compareFunctor(int _flags) : flags(_flags)
explicit compareFunctor(int _flags) : flags(_flags)
{
}
inline bool operator()(CardItem *a, CardItem *b) const

View file

@ -35,7 +35,7 @@ const FilterItemList *LogicMap::findTypeList(CardFilter::Type type) const
{
QList<FilterItemList *>::const_iterator i;
for (i = childNodes.constBegin(); i != childNodes.constEnd(); i++) {
for (i = childNodes.constBegin(); i != childNodes.constEnd(); ++i) {
if ((*i)->type == type) {
return *i;
}
@ -49,7 +49,7 @@ FilterItemList *LogicMap::typeList(CardFilter::Type type)
QList<FilterItemList *>::iterator i;
int count = 0;
for (i = childNodes.begin(); i != childNodes.end(); i++) {
for (i = childNodes.begin(); i != childNodes.end(); ++i) {
if ((*i)->type == type) {
break;
}

View file

@ -220,7 +220,6 @@ QModelIndex FilterTreeModel::parent(const QModelIndex &ind) const
{
const FilterTreeNode *node;
FilterTreeNode *parent;
int row;
QModelIndex idx;
if (!ind.isValid())
@ -232,7 +231,7 @@ QModelIndex FilterTreeModel::parent(const QModelIndex &ind) const
parent = node->parent();
if (parent) {
row = parent->index();
int row = parent->index();
if (row < 0)
return QModelIndex();
idx = createIndex(row, 0, parent);

View file

@ -9,7 +9,7 @@
#include <QTextCursor>
#include <QWidget>
LineEditCompleter::LineEditCompleter(QWidget *parent) : QLineEdit(parent)
LineEditCompleter::LineEditCompleter(QWidget *parent) : QLineEdit(parent), c(nullptr)
{
}

View file

@ -796,6 +796,7 @@ MessageLogWidget::MessageLogWidget(const TabSupervisor *_tabSupervisor,
const UserlistProxy *_userlistProxy,
TabGame *_game,
QWidget *parent)
: ChatView(_tabSupervisor, _userlistProxy, _game, true, parent), currentContext(MessageContext_None)
: ChatView(_tabSupervisor, _userlistProxy, _game, true, parent), mulliganNumber(0),
currentContext(MessageContext_None)
{
}

View file

@ -20,7 +20,6 @@ private:
CardInfo *card;
QList<CardSet *> sortedSets;
int setIndex;
bool hq;
public:
PictureToLoad(CardInfo *_card = 0);

View file

@ -3,7 +3,7 @@
#include "update_downloader.h"
UpdateDownloader::UpdateDownloader(QObject *parent) : QObject(parent)
UpdateDownloader::UpdateDownloader(QObject *parent) : QObject(parent), response(nullptr)
{
netMan = new QNetworkAccessManager(this);
}