aboutsummaryrefslogtreecommitdiff
path: root/launcher
diff options
context:
space:
mode:
authorRachel Powers <508861+Ryex@users.noreply.github.com>2023-06-30 23:51:15 -0700
committerRachel Powers <508861+Ryex@users.noreply.github.com>2023-07-01 23:39:38 -0700
commit8d7dcdfc5b2a231a1304878e25929e6f4ff4e338 (patch)
tree761f56c74858e9811b9fa78ff63392f51836678c /launcher
parent98d6904e4a84836c1b9ec662b0b8a49d5282e27b (diff)
downloadPrismLauncher-8d7dcdfc5b2a231a1304878e25929e6f4ff4e338.tar.gz
PrismLauncher-8d7dcdfc5b2a231a1304878e25929e6f4ff4e338.tar.bz2
PrismLauncher-8d7dcdfc5b2a231a1304878e25929e6f4ff4e338.zip
chore: fix shadowed member and signed/unsigned mismatch
Signed-off-by: Rachel Powers <508861+Ryex@users.noreply.github.com> chore: supress unused with [[maybe_unused]] Signed-off-by: Rachel Powers <508861+Ryex@users.noreply.github.com> chore: unshadow ^&^& static_cast implicit return Signed-off-by: Rachel Powers <508861+Ryex@users.noreply.github.com> chore: deshadow and mark unused in parse task Signed-off-by: Rachel Powers <508861+Ryex@users.noreply.github.com> chore: mark unused in folder models Signed-off-by: Rachel Powers <508861+Ryex@users.noreply.github.com> chore: deshadow and mark unused with instances Signed-off-by: Rachel Powers <508861+Ryex@users.noreply.github.com> chore: more deshadow and unused Signed-off-by: Rachel Powers <508861+Ryex@users.noreply.github.com> chore: remove uneeded simicolons Signed-off-by: Rachel Powers <508861+Ryex@users.noreply.github.com> chore: mark unused Signed-off-by: Rachel Powers <508861+Ryex@users.noreply.github.com> chore: prevent shadow Signed-off-by: Rachel Powers <508861+Ryex@users.noreply.github.com>
Diffstat (limited to 'launcher')
-rw-r--r--launcher/DesktopServices.cpp2
-rw-r--r--launcher/InstanceList.cpp128
-rw-r--r--launcher/NullInstance.h2
-rw-r--r--launcher/RecursiveFileSystemWatcher.cpp2
-rw-r--r--launcher/VersionProxyModel.cpp36
-rw-r--r--launcher/filelink/FileLink.cpp2
-rw-r--r--launcher/icons/IconUtils.cpp4
-rw-r--r--launcher/meta/BaseEntity.cpp6
-rw-r--r--launcher/minecraft/MinecraftInstance.cpp6
-rw-r--r--launcher/minecraft/MojangDownloadInfo.h10
-rw-r--r--launcher/minecraft/OneSixVersionFormat.cpp2
-rw-r--r--launcher/minecraft/PackProfile.cpp18
-rw-r--r--launcher/minecraft/PackProfile.h2
-rw-r--r--launcher/minecraft/ProfileUtils.cpp2
-rw-r--r--launcher/minecraft/World.cpp12
-rw-r--r--launcher/minecraft/WorldList.cpp11
-rw-r--r--launcher/minecraft/auth/AccountData.cpp4
-rw-r--r--launcher/minecraft/auth/AccountList.cpp2
-rw-r--r--launcher/minecraft/auth/Parsers.cpp8
-rw-r--r--launcher/minecraft/auth/steps/EntitlementsStep.cpp4
-rw-r--r--launcher/minecraft/gameoptions/GameOptions.cpp3
-rw-r--r--launcher/minecraft/launch/LauncherPartLaunch.cpp2
-rw-r--r--launcher/minecraft/mod/Mod.h2
-rw-r--r--launcher/minecraft/mod/ModDetails.h19
-rw-r--r--launcher/minecraft/mod/ModFolderModel.cpp2
-rw-r--r--launcher/minecraft/mod/ResourceFolderModel.cpp6
-rw-r--r--launcher/minecraft/mod/ResourceFolderModel.h4
-rw-r--r--launcher/minecraft/mod/ResourcePackFolderModel.cpp3
-rw-r--r--launcher/minecraft/mod/TexturePackFolderModel.cpp2
-rw-r--r--launcher/minecraft/mod/tasks/GetModDependenciesTask.cpp20
-rw-r--r--launcher/minecraft/mod/tasks/LocalModParseTask.cpp26
-rw-r--r--launcher/minecraft/services/CapeChange.cpp2
-rw-r--r--launcher/modplatform/ModIndex.h2
-rw-r--r--launcher/modplatform/ResourceAPI.h4
-rw-r--r--launcher/modplatform/flame/FileResolvingTask.cpp2
-rw-r--r--launcher/modplatform/flame/FlameModIndex.cpp7
-rw-r--r--launcher/modplatform/helpers/NetworkResourceAPI.cpp3
-rw-r--r--launcher/modplatform/modrinth/ModrinthPackExportTask.cpp12
-rw-r--r--launcher/modplatform/modrinth/ModrinthPackIndex.cpp6
-rw-r--r--launcher/modplatform/packwiz/Packwiz.cpp5
-rw-r--r--launcher/modplatform/technic/TechnicPackProcessor.cpp16
-rw-r--r--launcher/news/NewsEntry.cpp7
-rw-r--r--launcher/screenshots/ImgurAlbumCreation.cpp2
-rw-r--r--launcher/screenshots/ImgurUpload.cpp2
-rw-r--r--launcher/tasks/ConcurrentTask.cpp2
-rw-r--r--launcher/tasks/Task.h7
-rw-r--r--launcher/tools/JProfiler.cpp2
-rw-r--r--launcher/tools/JVisualVM.cpp2
-rw-r--r--launcher/translations/POTranslator.cpp2
-rw-r--r--launcher/translations/TranslationsModel.cpp12
-rw-r--r--launcher/ui/MainWindow.cpp27
-rw-r--r--launcher/ui/dialogs/CopyInstanceDialog.cpp2
-rw-r--r--launcher/ui/dialogs/ExportInstanceDialog.cpp8
-rw-r--r--launcher/ui/dialogs/NewInstanceDialog.cpp2
-rw-r--r--launcher/ui/dialogs/ProfileSetupDialog.cpp16
-rw-r--r--launcher/ui/dialogs/ProgressDialog.cpp20
-rw-r--r--launcher/ui/dialogs/ProgressDialog.h2
-rw-r--r--launcher/ui/dialogs/ResourceDownloadDialog.cpp2
-rw-r--r--launcher/ui/dialogs/ReviewMessageBox.cpp2
-rw-r--r--launcher/ui/dialogs/SkinUploadDialog.cpp6
-rw-r--r--launcher/ui/instanceview/InstanceDelegate.cpp22
-rw-r--r--launcher/ui/instanceview/InstanceView.cpp82
-rw-r--r--launcher/ui/instanceview/VisualGroup.cpp6
-rw-r--r--launcher/ui/pages/global/AccountListPage.cpp5
-rw-r--r--launcher/ui/pages/global/JavaPage.cpp2
-rw-r--r--launcher/ui/pages/global/ProxyPage.cpp2
-rw-r--r--launcher/ui/pages/instance/ExternalResourcesPage.cpp2
-rw-r--r--launcher/ui/pages/instance/InstanceSettingsPage.cpp2
-rw-r--r--launcher/ui/pages/instance/ModFolderPage.cpp2
-rw-r--r--launcher/ui/pages/instance/OtherLogsPage.cpp22
-rw-r--r--launcher/ui/pages/instance/ResourcePackPage.cpp2
-rw-r--r--launcher/ui/pages/instance/ServersPage.cpp4
-rw-r--r--launcher/ui/pages/instance/TexturePackPage.cpp2
-rw-r--r--launcher/ui/pages/instance/VersionPage.cpp4
-rw-r--r--launcher/ui/pages/instance/WorldListPage.cpp2
-rw-r--r--launcher/ui/pages/modplatform/ImportPage.cpp6
-rw-r--r--launcher/ui/pages/modplatform/ResourceModel.cpp6
-rw-r--r--launcher/ui/pages/modplatform/ResourcePackModel.cpp3
-rw-r--r--launcher/ui/pages/modplatform/ResourcePage.cpp6
-rw-r--r--launcher/ui/pages/modplatform/ResourcePage.h5
-rw-r--r--launcher/ui/pages/modplatform/ShaderPackModel.cpp3
-rw-r--r--launcher/ui/pages/modplatform/atlauncher/AtlOptionalModDialog.cpp16
-rw-r--r--launcher/ui/pages/modplatform/atlauncher/AtlOptionalModDialog.h2
-rw-r--r--launcher/ui/pages/modplatform/atlauncher/AtlPage.cpp12
-rw-r--r--launcher/ui/pages/modplatform/flame/FlameModel.cpp4
-rw-r--r--launcher/ui/pages/modplatform/flame/FlamePage.cpp6
-rw-r--r--launcher/ui/pages/modplatform/flame/FlameResourceModels.cpp2
-rw-r--r--launcher/ui/pages/modplatform/legacy_ftb/ListModel.cpp6
-rw-r--r--launcher/ui/pages/modplatform/legacy_ftb/Page.cpp18
-rw-r--r--launcher/ui/pages/modplatform/modrinth/ModrinthModel.cpp4
-rw-r--r--launcher/ui/pages/modplatform/modrinth/ModrinthPage.cpp6
-rw-r--r--launcher/ui/pages/modplatform/modrinth/ModrinthResourceModels.cpp2
-rw-r--r--launcher/ui/pages/modplatform/technic/TechnicPage.cpp8
-rw-r--r--launcher/ui/themes/CustomTheme.cpp2
-rw-r--r--launcher/ui/widgets/InfoFrame.cpp6
-rw-r--r--launcher/ui/widgets/SubTaskProgressBar.cpp2
96 files changed, 409 insertions, 413 deletions
diff --git a/launcher/DesktopServices.cpp b/launcher/DesktopServices.cpp
index 2984a1b4..c2002126 100644
--- a/launcher/DesktopServices.cpp
+++ b/launcher/DesktopServices.cpp
@@ -104,7 +104,7 @@ bool IndirectOpen(T callable, qint64 *pid_forked = nullptr)
#endif
namespace DesktopServices {
-bool openDirectory(const QString &path, bool ensureExists)
+bool openDirectory(const QString &path, [[maybe_unused]] bool ensureExists)
{
qDebug() << "Opening directory" << path;
QDir parentPath;
diff --git a/launcher/InstanceList.cpp b/launcher/InstanceList.cpp
index b361b286..a5950659 100644
--- a/launcher/InstanceList.cpp
+++ b/launcher/InstanceList.cpp
@@ -41,9 +41,9 @@
#include <QJsonArray>
#include <QJsonDocument>
#include <QMimeData>
+#include <QPair>
#include <QSet>
#include <QStack>
-#include <QPair>
#include <QTextStream>
#include <QThread>
#include <QTimer>
@@ -96,7 +96,11 @@ Qt::DropActions InstanceList::supportedDropActions() const
return Qt::MoveAction;
}
-bool InstanceList::canDropMimeData(const QMimeData* data, Qt::DropAction action, int row, int column, const QModelIndex& parent) const
+bool InstanceList::canDropMimeData(const QMimeData* data,
+ [[maybe_unused]] Qt::DropAction action,
+ [[maybe_unused]] int row,
+ [[maybe_unused]] int column,
+ [[maybe_unused]] const QModelIndex& parent) const
{
if (data && data->hasFormat("application/x-instanceid")) {
return true;
@@ -104,7 +108,11 @@ bool InstanceList::canDropMimeData(const QMimeData* data, Qt::DropAction action,
return false;
}
-bool InstanceList::dropMimeData(const QMimeData* data, Qt::DropAction action, int row, int column, const QModelIndex& parent)
+bool InstanceList::dropMimeData(const QMimeData* data,
+ [[maybe_unused]] Qt::DropAction action,
+ [[maybe_unused]] int row,
+ [[maybe_unused]] int column,
+ [[maybe_unused]] const QModelIndex& parent)
{
if (data && data->hasFormat("application/x-instanceid")) {
return true;
@@ -129,7 +137,7 @@ QMimeData* InstanceList::mimeData(const QModelIndexList& indexes) const
return mimeData;
}
-QStringList InstanceList::getLinkedInstancesById(const QString &id) const
+QStringList InstanceList::getLinkedInstancesById(const QString& id) const
{
QStringList linkedInstances;
for (auto inst : m_instances) {
@@ -158,42 +166,34 @@ QVariant InstanceList::data(const QModelIndex& index, int role) const
if (!index.isValid()) {
return QVariant();
}
- BaseInstance *pdata = static_cast<BaseInstance *>(index.internalPointer());
- switch (role)
- {
- case InstancePointerRole:
- {
- QVariant v = QVariant::fromValue((void *)pdata);
- return v;
- }
- case InstanceIDRole:
- {
- return pdata->id();
- }
- case Qt::EditRole:
- case Qt::DisplayRole:
- {
- return pdata->name();
- }
- case Qt::AccessibleTextRole:
- {
- return tr("%1 Instance").arg(pdata->name());
- }
- case Qt::ToolTipRole:
- {
- return pdata->instanceRoot();
- }
- case Qt::DecorationRole:
- {
- return pdata->iconKey();
- }
- // HACK: see InstanceView.h in gui!
- case GroupRole:
- {
- return getInstanceGroup(pdata->id());
- }
- default:
- break;
+ BaseInstance* pdata = static_cast<BaseInstance*>(index.internalPointer());
+ switch (role) {
+ case InstancePointerRole: {
+ QVariant v = QVariant::fromValue((void*)pdata);
+ return v;
+ }
+ case InstanceIDRole: {
+ return pdata->id();
+ }
+ case Qt::EditRole:
+ case Qt::DisplayRole: {
+ return pdata->name();
+ }
+ case Qt::AccessibleTextRole: {
+ return tr("%1 Instance").arg(pdata->name());
+ }
+ case Qt::ToolTipRole: {
+ return pdata->instanceRoot();
+ }
+ case Qt::DecorationRole: {
+ return pdata->iconKey();
+ }
+ // HACK: see InstanceView.h in gui!
+ case GroupRole: {
+ return getInstanceGroup(pdata->id());
+ }
+ default:
+ break;
}
return QVariant();
}
@@ -320,16 +320,18 @@ bool InstanceList::trashInstance(const InstanceId& id)
}
qDebug() << "Instance" << id << "has been trashed by the launcher.";
- m_trashHistory.push({id, inst->instanceRoot(), trashedLoc, cachedGroupId});
-
+ m_trashHistory.push({ id, inst->instanceRoot(), trashedLoc, cachedGroupId });
+
return true;
}
-bool InstanceList::trashedSomething() {
+bool InstanceList::trashedSomething()
+{
return !m_trashHistory.empty();
}
-void InstanceList::undoTrashInstance() {
+void InstanceList::undoTrashInstance()
+{
if (m_trashHistory.empty()) {
qWarning() << "Nothing to recover from trash.";
return;
@@ -558,7 +560,7 @@ InstancePtr InstanceList::getInstanceByManagedName(const QString& managed_name)
return {};
}
-QModelIndex InstanceList::getInstanceIndexById(const QString &id) const
+QModelIndex InstanceList::getInstanceIndexById(const QString& id) const
{
return index(getInstIndex(getInstanceById(id).get()));
}
@@ -597,13 +599,11 @@ InstancePtr InstanceList::loadInstance(const InstanceId& id)
QString inst_type = instanceSettings->get("InstanceType").toString();
- // NOTE: Some PolyMC versions didn't save the InstanceType properly. We will just bank on the probability that this is probably a OneSix instance
- if (inst_type == "OneSix" || inst_type.isEmpty())
- {
+ // NOTE: Some PolyMC versions didn't save the InstanceType properly. We will just bank on the probability that this is probably a OneSix
+ // instance
+ if (inst_type == "OneSix" || inst_type.isEmpty()) {
inst.reset(new MinecraftInstance(m_globalSettings, instanceSettings, instanceRoot));
- }
- else
- {
+ } else {
inst.reset(new NullInstance(m_globalSettings, instanceSettings, instanceRoot));
}
qDebug() << "Loaded instance " << inst->name() << " from " << inst->instanceRoot();
@@ -759,7 +759,7 @@ void InstanceList::instanceDirContentsChanged(const QString& path)
emit instancesChanged();
}
-void InstanceList::on_InstFolderChanged(const Setting& setting, QVariant value)
+void InstanceList::on_InstFolderChanged( [[maybe_unused]] const Setting& setting, QVariant value)
{
QString newInstDir = QDir(value.toString()).canonicalPath();
if (newInstDir != m_instDir) {
@@ -820,21 +820,17 @@ class InstanceStaging : public Task {
return Task::abort();
}
- bool canAbort() const override
- {
- return (m_child && m_child->canAbort());
- }
+ bool canAbort() const override { return (m_child && m_child->canAbort()); }
protected:
virtual void executeTask() override { m_child->start(); }
QStringList warnings() const override { return m_child->warnings(); }
private slots:
- void childSucceded()
+ void childSucceeded()
{
unsigned sleepTime = backoff();
- if (m_parent->commitStagedInstance(m_stagingPath, m_instance_name, m_groupName, *m_child.get()))
- {
+ if (m_parent->commitStagedInstance(m_stagingPath, m_instance_name, m_groupName, *m_child.get())) {
emitSucceeded();
return;
}
@@ -852,13 +848,10 @@ class InstanceStaging : public Task {
emitFailed(reason);
}
- void childAborted()
- {
- emitAborted();
- }
+ void childAborted() { emitAborted(); }
-private:
- InstanceList * m_parent;
+ private:
+ InstanceL