fix: warnings when compiling with Qt 6.10 (#6422)
This commit is contained in:
@@ -65,14 +65,21 @@ QString insecurePath()
|
||||
QJsonDocument loadInsecure()
|
||||
{
|
||||
QFile file(insecurePath());
|
||||
file.open(QIODevice::ReadOnly);
|
||||
if (!file.open(QIODevice::ReadOnly))
|
||||
{
|
||||
return {};
|
||||
}
|
||||
|
||||
return QJsonDocument::fromJson(file.readAll());
|
||||
}
|
||||
|
||||
void storeInsecure(const QJsonDocument &doc)
|
||||
{
|
||||
QSaveFile file(insecurePath());
|
||||
file.open(QIODevice::WriteOnly);
|
||||
if (!file.open(QIODevice::WriteOnly))
|
||||
{
|
||||
return;
|
||||
}
|
||||
file.write(doc.toJson());
|
||||
file.commit();
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
#define QT_NO_CAST_FROM_ASCII // avoids unexpected implicit casts
|
||||
#include "common/LinkParser.hpp"
|
||||
|
||||
#include "common/QLogging.hpp"
|
||||
#include "util/QCompareTransparent.hpp"
|
||||
|
||||
#include <QFile>
|
||||
@@ -20,7 +21,12 @@ TldSet &tlds()
|
||||
{
|
||||
static TldSet tlds = [] {
|
||||
QFile file(QStringLiteral(":/tlds.txt"));
|
||||
file.open(QFile::ReadOnly);
|
||||
bool ok = file.open(QFile::ReadOnly);
|
||||
if (!ok)
|
||||
{
|
||||
assert(false && "Resources not available");
|
||||
qCWarning(chatterinoApp) << "Resources not available";
|
||||
}
|
||||
QTextStream stream(&file);
|
||||
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
|
||||
|
||||
@@ -9,7 +9,10 @@ namespace chatterino {
|
||||
Modes::Modes()
|
||||
{
|
||||
QFile file(combinePath(QCoreApplication::applicationDirPath(), "modes"));
|
||||
file.open(QIODevice::ReadOnly);
|
||||
if (!file.open(QIODevice::ReadOnly))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
while (!file.atEnd())
|
||||
{
|
||||
|
||||
@@ -14,7 +14,10 @@ namespace {
|
||||
QJsonArray loadWindowArray(const QString &settingsPath)
|
||||
{
|
||||
QFile file(settingsPath);
|
||||
file.open(QIODevice::ReadOnly);
|
||||
if (!file.open(QIODevice::ReadOnly))
|
||||
{
|
||||
return {};
|
||||
}
|
||||
QByteArray data = file.readAll();
|
||||
QJsonDocument document = QJsonDocument::fromJson(data);
|
||||
QJsonArray windows_arr = document.object().value("windows").toArray();
|
||||
|
||||
Reference in New Issue
Block a user