Remove several warnings when building the project

Signed-off-by: Yihe Li <winmikedows@hotmail.com>
This commit is contained in:
Yihe Li 2025-06-02 17:00:13 +08:00
parent d667dfe223
commit 5ccdb0a477
No known key found for this signature in database
8 changed files with 9 additions and 9 deletions

View file

@ -70,7 +70,7 @@ class NullInstance : public BaseInstance {
return out; return out;
} }
QString modsRoot() const override { return QString(); } QString modsRoot() const override { return QString(); }
void updateRuntimeContext() void updateRuntimeContext() override
{ {
// NOOP // NOOP
} }

View file

@ -501,7 +501,7 @@ QString JavaUtils::getJavaCheckPath()
QStringList getMinecraftJavaBundle() QStringList getMinecraftJavaBundle()
{ {
QStringList processpaths; QStringList processpaths;
#if defined(Q_OS_OSX) #if defined(Q_OS_MACOS)
processpaths << FS::PathCombine(QDir::homePath(), FS::PathCombine("Library", "Application Support", "minecraft", "runtime")); processpaths << FS::PathCombine(QDir::homePath(), FS::PathCombine("Library", "Application Support", "minecraft", "runtime"));
#elif defined(Q_OS_WIN32) #elif defined(Q_OS_WIN32)

View file

@ -104,7 +104,7 @@
#define IBUS "@im=ibus" #define IBUS "@im=ibus"
static bool switcherooSetupGPU(QProcessEnvironment& env) [[maybe_unused]] static bool switcherooSetupGPU(QProcessEnvironment& env)
{ {
#ifdef WITH_QTDBUS #ifdef WITH_QTDBUS
if (!QDBusConnection::systemBus().isConnected()) if (!QDBusConnection::systemBus().isConnected())

View file

@ -45,7 +45,7 @@ bool MCEditTool::check(const QString& toolPath, QString& error)
QString MCEditTool::getProgramPath() QString MCEditTool::getProgramPath()
{ {
#ifdef Q_OS_OSX #ifdef Q_OS_MACOS
return path(); return path();
#else #else
const QString mceditPath = path(); const QString mceditPath = path();

View file

@ -156,7 +156,7 @@ void ExternalToolsPage::on_mceditPathBtn_clicked()
QString raw_dir = ui->mceditPathEdit->text(); QString raw_dir = ui->mceditPathEdit->text();
QString error; QString error;
do { do {
#ifdef Q_OS_OSX #ifdef Q_OS_MACOS
raw_dir = QFileDialog::getOpenFileName(this, tr("MCEdit Application"), raw_dir); raw_dir = QFileDialog::getOpenFileName(this, tr("MCEdit Application"), raw_dir);
#else #else
raw_dir = QFileDialog::getExistingDirectory(this, tr("MCEdit Folder"), raw_dir); raw_dir = QFileDialog::getExistingDirectory(this, tr("MCEdit Folder"), raw_dir);

View file

@ -16,7 +16,7 @@ void ServerPingTask::executeTask()
// Resolve the actual IP and port for the server // Resolve the actual IP and port for the server
McResolver* resolver = new McResolver(nullptr, m_domain, m_port); McResolver* resolver = new McResolver(nullptr, m_domain, m_port);
QObject::connect(resolver, &McResolver::succeeded, this, [this, resolver](QString ip, int port) { QObject::connect(resolver, &McResolver::succeeded, this, [this](QString ip, int port) {
qDebug() << "Resolved Address for" << m_domain << ": " << ip << ":" << port; qDebug() << "Resolved Address for" << m_domain << ": " << ip << ":" << port;
// Now that we have the IP and port, query the server // Now that we have the IP and port, query the server
@ -30,7 +30,7 @@ void ServerPingTask::executeTask()
QObject::connect(client, &McClient::failed, this, [this](QString error) { emitFailed(error); }); QObject::connect(client, &McClient::failed, this, [this](QString error) { emitFailed(error); });
// Delete McClient object when done // Delete McClient object when done
QObject::connect(client, &McClient::finished, this, [this, client]() { client->deleteLater(); }); QObject::connect(client, &McClient::finished, this, [client]() { client->deleteLater(); });
client->getStatusData(); client->getStatusData();
}); });
QObject::connect(resolver, &McResolver::failed, this, [this](QString error) { emitFailed(error); }); QObject::connect(resolver, &McResolver::failed, this, [this](QString error) { emitFailed(error); });

View file

@ -36,7 +36,7 @@ namespace FTBImportAPP {
QString getFTBRoot() QString getFTBRoot()
{ {
QString partialPath = QDir::homePath(); QString partialPath = QDir::homePath();
#if defined(Q_OS_OSX) #if defined(Q_OS_MACOS)
partialPath = FS::PathCombine(partialPath, "Library/Application Support"); partialPath = FS::PathCombine(partialPath, "Library/Application Support");
#endif #endif
return FS::PathCombine(partialPath, ".ftba"); return FS::PathCombine(partialPath, ".ftba");

View file

@ -166,7 +166,7 @@ void MacSparkleUpdater::setAllowedChannels(const QSet<QString>& channels) {
QString channelsConfig = ""; QString channelsConfig = "";
// Convert QSet<QString> -> NSSet<NSString> // Convert QSet<QString> -> NSSet<NSString>
NSMutableSet<NSString*>* nsChannels = [NSMutableSet setWithCapacity:channels.count()]; NSMutableSet<NSString*>* nsChannels = [NSMutableSet setWithCapacity:channels.count()];
for (const QString channel : channels) { for (const QString& channel : channels) {
[nsChannels addObject:channel.toNSString()]; [nsChannels addObject:channel.toNSString()];
channelsConfig += channel + " "; channelsConfig += channel + " ";
} }