mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-07-01 11:03:54 -07:00
Lint.
Took 3 minutes
This commit is contained in:
parent
337b644d66
commit
de7bb7ddb9
4 changed files with 11 additions and 6 deletions
|
|
@ -18,8 +18,9 @@ void IntentUrlParser::handle(const QString &urlStr)
|
||||||
{
|
{
|
||||||
QUrl url(urlStr);
|
QUrl url(urlStr);
|
||||||
|
|
||||||
if (url.scheme() != "cockatrice")
|
if (url.scheme() != "cockatrice") {
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
const QString action = url.host();
|
const QString action = url.host();
|
||||||
QUrlQuery query(url);
|
QUrlQuery query(url);
|
||||||
|
|
|
||||||
|
|
@ -153,7 +153,7 @@ public:
|
||||||
RemoteClient *getRemoteClient() const
|
RemoteClient *getRemoteClient() const
|
||||||
{
|
{
|
||||||
return client;
|
return client;
|
||||||
};
|
}
|
||||||
|
|
||||||
TabSupervisor *getTabSupervisor() const
|
TabSupervisor *getTabSupervisor() const
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -59,15 +59,17 @@ void SingleInstanceManager::handleNewConnection()
|
||||||
while (true) {
|
while (true) {
|
||||||
// Step 1: read size
|
// Step 1: read size
|
||||||
if (*expectedSize == 0) {
|
if (*expectedSize == 0) {
|
||||||
if (buffer->size() < static_cast<int>(sizeof(quint32)))
|
if (buffer->size() < static_cast<int>(sizeof(quint32))) {
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
stream >> *expectedSize;
|
stream >> *expectedSize;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Step 2: wait for full payload
|
// Step 2: wait for full payload
|
||||||
if (buffer->size() < static_cast<int>(sizeof(quint32) + *expectedSize))
|
if (buffer->size() < static_cast<int>(sizeof(quint32) + *expectedSize)) {
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// Step 3: extract payload
|
// Step 3: extract payload
|
||||||
QByteArray payload = buffer->mid(sizeof(quint32), *expectedSize);
|
QByteArray payload = buffer->mid(sizeof(quint32), *expectedSize);
|
||||||
|
|
|
||||||
|
|
@ -313,8 +313,9 @@ int ServersSettings::findServerIndex(const QString &host, const QString &port) c
|
||||||
bool ServersSettings::hasUsername(const QString &host, const QString &port) const
|
bool ServersSettings::hasUsername(const QString &host, const QString &port) const
|
||||||
{
|
{
|
||||||
int index = findServerIndex(host, port);
|
int index = findServerIndex(host, port);
|
||||||
if (index < 0)
|
if (index < 0) {
|
||||||
return false;
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
QString user = getValue(QString("username%1").arg(index), "server", "server_details").toString();
|
QString user = getValue(QString("username%1").arg(index), "server", "server_details").toString();
|
||||||
return !user.isEmpty();
|
return !user.isEmpty();
|
||||||
|
|
@ -323,8 +324,9 @@ bool ServersSettings::hasUsername(const QString &host, const QString &port) cons
|
||||||
bool ServersSettings::hasCredentials(const QString &host, const QString &port) const
|
bool ServersSettings::hasCredentials(const QString &host, const QString &port) const
|
||||||
{
|
{
|
||||||
int index = findServerIndex(host, port);
|
int index = findServerIndex(host, port);
|
||||||
if (index < 0)
|
if (index < 0) {
|
||||||
return false;
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
bool save = getValue(QString("savePassword%1").arg(index), "server", "server_details").toBool();
|
bool save = getValue(QString("savePassword%1").arg(index), "server", "server_details").toBool();
|
||||||
QString password = getValue(QString("password%1").arg(index), "server", "server_details").toString();
|
QString password = getValue(QString("password%1").arg(index), "server", "server_details").toString();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue