fix: fix warnings reported by LGTM.com
This commit is contained in:
parent
03e454b71d
commit
9ec260619b
@ -79,6 +79,8 @@ QString AccountTask::getStateMessage() const
|
|||||||
bool AccountTask::changeState(AccountTaskState newState, QString reason)
|
bool AccountTask::changeState(AccountTaskState newState, QString reason)
|
||||||
{
|
{
|
||||||
m_taskState = newState;
|
m_taskState = newState;
|
||||||
|
// FIXME: virtual method invoked in constructor.
|
||||||
|
// We want that behavior, but maybe make it less weird?
|
||||||
setStatus(getStateMessage());
|
setStatus(getStateMessage());
|
||||||
switch(newState) {
|
switch(newState) {
|
||||||
case AccountTaskState::STATE_CREATED: {
|
case AccountTaskState::STATE_CREATED: {
|
||||||
|
@ -59,7 +59,7 @@ class FlameAPI : public NetworkModAPI {
|
|||||||
};
|
};
|
||||||
|
|
||||||
public:
|
public:
|
||||||
static auto getMappedModLoader(const ModLoaderTypes loaders) -> const int
|
static auto getMappedModLoader(const ModLoaderTypes loaders) -> int
|
||||||
{
|
{
|
||||||
// https://docs.curseforge.com/?http#tocS_ModLoaderType
|
// https://docs.curseforge.com/?http#tocS_ModLoaderType
|
||||||
if (loaders & Forge)
|
if (loaders & Forge)
|
||||||
|
@ -329,6 +329,11 @@ POTranslator::POTranslator(const QString& filename, QObject* parent) : QTranslat
|
|||||||
d->reload();
|
d->reload();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
POTranslator::~POTranslator()
|
||||||
|
{
|
||||||
|
delete d;
|
||||||
|
}
|
||||||
|
|
||||||
QString POTranslator::translate(const char* context, const char* sourceText, const char* disambiguation, int n) const
|
QString POTranslator::translate(const char* context, const char* sourceText, const char* disambiguation, int n) const
|
||||||
{
|
{
|
||||||
if(disambiguation)
|
if(disambiguation)
|
||||||
|
@ -9,6 +9,7 @@ class POTranslator : public QTranslator
|
|||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
explicit POTranslator(const QString& filename, QObject * parent = nullptr);
|
explicit POTranslator(const QString& filename, QObject * parent = nullptr);
|
||||||
|
virtual ~POTranslator();
|
||||||
QString translate(const char * context, const char * sourceText, const char * disambiguation, int n) const override;
|
QString translate(const char * context, const char * sourceText, const char * disambiguation, int n) const override;
|
||||||
bool isEmpty() const override;
|
bool isEmpty() const override;
|
||||||
private:
|
private:
|
||||||
|
@ -162,15 +162,15 @@ bool LocalPeer::sendMessage(const QByteArray &message, int timeout)
|
|||||||
|
|
||||||
QLocalSocket socket;
|
QLocalSocket socket;
|
||||||
bool connOk = false;
|
bool connOk = false;
|
||||||
for(int i = 0; i < 2; i++) {
|
int tries = 2;
|
||||||
|
for(int i = 0; i < tries; i++) {
|
||||||
// Try twice, in case the other instance is just starting up
|
// Try twice, in case the other instance is just starting up
|
||||||
socket.connectToServer(socketName);
|
socket.connectToServer(socketName);
|
||||||
connOk = socket.waitForConnected(timeout/2);
|
connOk = socket.waitForConnected(timeout/2);
|
||||||
if (connOk || i)
|
if (!connOk && i < (tries - 1))
|
||||||
{
|
{
|
||||||
break;
|
std::this_thread::sleep_for(std::chrono::milliseconds(250));
|
||||||
}
|
}
|
||||||
std::this_thread::sleep_for(std::chrono::milliseconds(250));
|
|
||||||
}
|
}
|
||||||
if (!connOk)
|
if (!connOk)
|
||||||
{
|
{
|
||||||
|
@ -79,7 +79,7 @@ element_value *element_value::readElementValue(util::membuffer &input,
|
|||||||
}
|
}
|
||||||
return new element_value_array(ARRAY, vals, pool);
|
return new element_value_array(ARRAY, vals, pool);
|
||||||
default:
|
default:
|
||||||
throw new java::classfile_exception();
|
throw java::classfile_exception();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -17,7 +17,7 @@ public:
|
|||||||
is_synthetic = false;
|
is_synthetic = false;
|
||||||
read_be(magic);
|
read_be(magic);
|
||||||
if (magic != 0xCAFEBABE)
|
if (magic != 0xCAFEBABE)
|
||||||
throw new classfile_exception();
|
throw classfile_exception();
|
||||||
read_be(minor_version);
|
read_be(minor_version);
|
||||||
read_be(major_version);
|
read_be(major_version);
|
||||||
constants.load(*this);
|
constants.load(*this);
|
||||||
@ -153,4 +153,4 @@ public:
|
|||||||
// FIXME: doesn't free up memory on delete
|
// FIXME: doesn't free up memory on delete
|
||||||
java::annotation_table visible_class_annotations;
|
java::annotation_table visible_class_annotations;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
#include "errors.h"
|
#include "errors.h"
|
||||||
|
#include "membuffer.h"
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
|
|
||||||
namespace java
|
namespace java
|
||||||
@ -90,7 +91,7 @@ public:
|
|||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
// invalid constant type!
|
// invalid constant type!
|
||||||
throw new classfile_exception();
|
throw classfile_exception();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
constant(int)
|
constant(int)
|
||||||
@ -210,7 +211,7 @@ public:
|
|||||||
{
|
{
|
||||||
if (constant_index == 0 || constant_index > constants.size())
|
if (constant_index == 0 || constant_index > constants.size())
|
||||||
{
|
{
|
||||||
throw new classfile_exception();
|
throw classfile_exception();
|
||||||
}
|
}
|
||||||
return constants[constant_index - 1];
|
return constants[constant_index - 1];
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user