mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-12 17:14:52 -07:00
Fixed most issues from codacy (#3050)
This commit is contained in:
parent
3c3e6ae68a
commit
e127cb74b6
16 changed files with 26 additions and 33 deletions
|
|
@ -115,11 +115,6 @@ int main(int argc, char *argv[])
|
|||
app.setApplicationName("Servatrice");
|
||||
app.setApplicationVersion(VERSION_STRING);
|
||||
|
||||
bool testRandom = false;
|
||||
bool testHashFunction = false;
|
||||
bool logToConsole = false;
|
||||
QString configPath;
|
||||
|
||||
QCommandLineParser parser;
|
||||
parser.addHelpOption();
|
||||
parser.addVersionOption();
|
||||
|
|
@ -138,10 +133,10 @@ int main(int argc, char *argv[])
|
|||
|
||||
parser.process(app);
|
||||
|
||||
testRandom = parser.isSet(testRandomOpt);
|
||||
testHashFunction = parser.isSet(testHashFunctionOpt);
|
||||
logToConsole = parser.isSet(logToConsoleOpt);
|
||||
configPath = parser.value(configPathOpt);
|
||||
bool testRandom = parser.isSet(testRandomOpt);
|
||||
bool testHashFunction = parser.isSet(testHashFunctionOpt);
|
||||
bool logToConsole = parser.isSet(logToConsoleOpt);
|
||||
QString configPath = parser.value(configPathOpt);
|
||||
|
||||
qRegisterMetaType<QList<int>>("QList<int>");
|
||||
|
||||
|
|
|
|||
|
|
@ -178,7 +178,9 @@ void Servatrice_IslServer::incomingConnection(qintptr socketDescriptor)
|
|||
QMetaObject::invokeMethod(interface, "initServer", Qt::QueuedConnection);
|
||||
}
|
||||
|
||||
Servatrice::Servatrice(QObject *parent) : Server(parent), uptime(0), shutdownTimer(0), isFirstShutdownMessage(true)
|
||||
Servatrice::Servatrice(QObject *parent)
|
||||
: Server(parent), authenticationMethod(AuthenticationNone), uptime(0), shutdownTimer(0),
|
||||
isFirstShutdownMessage(true)
|
||||
{
|
||||
qRegisterMetaType<QSqlDatabase>("QSqlDatabase");
|
||||
}
|
||||
|
|
@ -398,7 +400,7 @@ bool Servatrice::initServer()
|
|||
else
|
||||
throw QString("islServer->listen()");
|
||||
}
|
||||
} catch (QString error) {
|
||||
} catch (QString &error) {
|
||||
qDebug() << "ERROR --" << error;
|
||||
return false;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
#include <QThread>
|
||||
|
||||
Servatrice_ConnectionPool::Servatrice_ConnectionPool(Servatrice_DatabaseInterface *_databaseInterface)
|
||||
: databaseInterface(_databaseInterface), clientCount(0)
|
||||
: databaseInterface(_databaseInterface), threaded(false), clientCount(0)
|
||||
{
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1015,7 +1015,7 @@ void Servatrice_DatabaseInterface::updateUsersLastLoginData(const QString &userN
|
|||
}
|
||||
|
||||
if (usersID) {
|
||||
int userCount;
|
||||
int userCount = 0;
|
||||
query = prepareQuery("select count(id) from {prefix}_user_analytics where id = :user_id");
|
||||
query->bindValue(":user_id", usersID);
|
||||
if (!execSqlQuery(query))
|
||||
|
|
|
|||
|
|
@ -564,7 +564,7 @@ Response::ResponseCode AbstractServerSocketInterface::cmdDeckDownload(const Comm
|
|||
DeckList *deck;
|
||||
try {
|
||||
deck = sqlInterface->getDeckFromDatabase(cmd.deck_id(), userInfo->id());
|
||||
} catch (Response::ResponseCode r) {
|
||||
} catch (Response::ResponseCode &r) {
|
||||
return r;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -10,7 +10,6 @@ class SettingsCache : public QSettings
|
|||
{
|
||||
Q_OBJECT
|
||||
private:
|
||||
QSettings *settings;
|
||||
bool isPortableBuild;
|
||||
|
||||
public:
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@
|
|||
|
||||
int SignalHandler::sigHupFD[2];
|
||||
|
||||
SignalHandler::SignalHandler(QObject *parent) : QObject(parent)
|
||||
SignalHandler::SignalHandler(QObject *parent) : QObject(parent), snHup(nullptr)
|
||||
{
|
||||
#ifdef Q_OS_UNIX
|
||||
::socketpair(AF_UNIX, SOCK_STREAM, 0, sigHupFD);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue