aboutsummaryrefslogtreecommitdiff
path: root/launcher/minecraft/mod/TexturePackFolderModel.cpp
diff options
context:
space:
mode:
authorTrial97 <alexandru.tripon97@gmail.com>2023-08-05 19:09:10 +0300
committerTrial97 <alexandru.tripon97@gmail.com>2023-08-05 19:09:10 +0300
commitb2fdd8359405c93d0d93aa8c68971c986a1f68cb (patch)
tree59859119373213ce04b2f5e2d7a95227b57be609 /launcher/minecraft/mod/TexturePackFolderModel.cpp
parent149b6d59cf848a3b3cd50b3aee1c112e9c47e633 (diff)
parentae793f6cf11658c9abc5111e82d5ba7b3e6af127 (diff)
downloadPrismLauncher-b2fdd8359405c93d0d93aa8c68971c986a1f68cb.tar.gz
PrismLauncher-b2fdd8359405c93d0d93aa8c68971c986a1f68cb.tar.bz2
PrismLauncher-b2fdd8359405c93d0d93aa8c68971c986a1f68cb.zip
Merge branch 'develop' of https://github.com/PrismLauncher/PrismLauncher into download_threads
Signed-off-by: Trial97 <alexandru.tripon97@gmail.com>
Diffstat (limited to 'launcher/minecraft/mod/TexturePackFolderModel.cpp')
-rw-r--r--launcher/minecraft/mod/TexturePackFolderModel.cpp26
1 files changed, 12 insertions, 14 deletions
diff --git a/launcher/minecraft/mod/TexturePackFolderModel.cpp b/launcher/minecraft/mod/TexturePackFolderModel.cpp
index 531a7023..9a9910fa 100644
--- a/launcher/minecraft/mod/TexturePackFolderModel.cpp
+++ b/launcher/minecraft/mod/TexturePackFolderModel.cpp
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: GPL-3.0-only
/*
- * PolyMC - Minecraft Launcher
+ * Prism Launcher - Minecraft Launcher
* Copyright (c) 2022 flowln <flowlnlnln@gmail.com>
* Copyright (C) 2022 Sefa Eyeoglu <contact@scrumplex.net>
*
@@ -42,14 +42,13 @@
#include "minecraft/mod/tasks/BasicFolderLoadTask.h"
#include "minecraft/mod/tasks/LocalTexturePackParseTask.h"
-TexturePackFolderModel::TexturePackFolderModel(const QString& dir, BaseInstance* instance)
- : ResourceFolderModel(QDir(dir), instance)
+TexturePackFolderModel::TexturePackFolderModel(const QString& dir, BaseInstance* instance) : ResourceFolderModel(QDir(dir), instance)
{
m_column_names = QStringList({ "Enable", "Image", "Name", "Last Modified" });
m_column_names_translated = QStringList({ tr("Enable"), tr("Image"), tr("Name"), tr("Last Modified") });
m_column_sort_keys = { SortType::ENABLED, SortType::NAME, SortType::NAME, SortType::DATE };
- m_column_resize_modes = { QHeaderView::ResizeToContents, QHeaderView::Interactive, QHeaderView::Stretch, QHeaderView::ResizeToContents};
-
+ m_column_resize_modes = { QHeaderView::ResizeToContents, QHeaderView::Interactive, QHeaderView::Stretch,
+ QHeaderView::ResizeToContents };
}
Task* TexturePackFolderModel::createUpdateTask()
@@ -62,7 +61,6 @@ Task* TexturePackFolderModel::createParseTask(Resource& resource)
return new LocalTexturePackParseTask(m_next_resolution_ticket, static_cast<TexturePack&>(resource));
}
-
QVariant TexturePackFolderModel::data(const QModelIndex& index, int role) const
{
if (!validateIndex(index))
@@ -85,28 +83,29 @@ QVariant TexturePackFolderModel::data(const QModelIndex& index, int role) const
if (column == NameColumn) {
if (at(row)->isSymLinkUnder(instDirPath())) {
return m_resources[row]->internal_id() +
- tr("\nWarning: This resource is symbolically linked from elsewhere. Editing it will also change the original."
- "\nCanonical Path: %1")
- .arg(at(row)->fileinfo().canonicalFilePath());;
+ tr("\nWarning: This resource is symbolically linked from elsewhere. Editing it will also change the original."
+ "\nCanonical Path: %1")
+ .arg(at(row)->fileinfo().canonicalFilePath());
+ ;
}
if (at(row)->isMoreThanOneHardLink()) {
return m_resources[row]->internal_id() +
- tr("\nWarning: This resource is hard linked elsewhere. Editing it will also change the original.");
+ tr("\nWarning: This resource is hard linked elsewhere. Editing it will also change the original.");
}
}
-
+
return m_resources[row]->internal_id();
case Qt::DecorationRole: {
if (column == NameColumn && (at(row)->isSymLinkUnder(instDirPath()) || at(row)->isMoreThanOneHardLink()))
return APPLICATION->getThemedIcon("status-yellow");
if (column == ImageColumn) {
- return at(row)->image({32, 32}, Qt::AspectRatioMode::KeepAspectRatioByExpanding);
+ return at(row)->image({ 32, 32 }, Qt::AspectRatioMode::KeepAspectRatioByExpanding);
}
return {};
}
case Qt::CheckStateRole:
if (column == ActiveColumn) {
- return m_resources[row]->enabled() ? Qt::Checked : Qt::Unchecked;
+ return m_resources[row]->enabled() ? Qt::Checked : Qt::Unchecked;
}
return {};
default:
@@ -153,4 +152,3 @@ int TexturePackFolderModel::columnCount(const QModelIndex& parent) const
{
return parent.isValid() ? 0 : NUM_COLUMNS;
}
-