mirror of
https://github.com/PrismLauncher/PrismLauncher.git
synced 2025-05-21 16:57:15 +02:00
Revert unwise refactor
Signed-off-by: TheKodeToad <TheKodeToad@proton.me>
This commit is contained in:
parent
2b22a1aebe
commit
ad1d5ddcdf
@ -483,19 +483,19 @@ QVariant ResourceFolderModel::data(const QModelIndex& index, int role) const
|
|||||||
switch (role) {
|
switch (role) {
|
||||||
case Qt::DisplayRole:
|
case Qt::DisplayRole:
|
||||||
switch (column) {
|
switch (column) {
|
||||||
case NAME_COLUMN:
|
case NameColumn:
|
||||||
return m_resources[row]->name();
|
return m_resources[row]->name();
|
||||||
case DATE_COLUMN:
|
case DateColumn:
|
||||||
return m_resources[row]->dateTimeChanged();
|
return m_resources[row]->dateTimeChanged();
|
||||||
case PROVIDER_COLUMN:
|
case ProviderColumn:
|
||||||
return m_resources[row]->provider();
|
return m_resources[row]->provider();
|
||||||
case SIZE_COLUMN:
|
case SizeColumn:
|
||||||
return m_resources[row]->sizeStr();
|
return m_resources[row]->sizeStr();
|
||||||
default:
|
default:
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
case Qt::ToolTipRole:
|
case Qt::ToolTipRole:
|
||||||
if (column == NAME_COLUMN) {
|
if (column == NameColumn) {
|
||||||
if (at(row).isSymLinkUnder(instDirPath())) {
|
if (at(row).isSymLinkUnder(instDirPath())) {
|
||||||
return m_resources[row]->internal_id() +
|
return m_resources[row]->internal_id() +
|
||||||
tr("\nWarning: This resource is symbolically linked from elsewhere. Editing it will also change the original."
|
tr("\nWarning: This resource is symbolically linked from elsewhere. Editing it will also change the original."
|
||||||
@ -511,14 +511,14 @@ QVariant ResourceFolderModel::data(const QModelIndex& index, int role) const
|
|||||||
|
|
||||||
return m_resources[row]->internal_id();
|
return m_resources[row]->internal_id();
|
||||||
case Qt::DecorationRole: {
|
case Qt::DecorationRole: {
|
||||||
if (column == NAME_COLUMN && (at(row).isSymLinkUnder(instDirPath()) || at(row).isMoreThanOneHardLink()))
|
if (column == NameColumn && (at(row).isSymLinkUnder(instDirPath()) || at(row).isMoreThanOneHardLink()))
|
||||||
return APPLICATION->getThemedIcon("status-yellow");
|
return APPLICATION->getThemedIcon("status-yellow");
|
||||||
|
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
case Qt::CheckStateRole:
|
case Qt::CheckStateRole:
|
||||||
switch (column) {
|
switch (column) {
|
||||||
case ACTIVE_COLUMN:
|
case ActiveColumn:
|
||||||
return m_resources[row]->enabled() ? Qt::Checked : Qt::Unchecked;
|
return m_resources[row]->enabled() ? Qt::Checked : Qt::Unchecked;
|
||||||
default:
|
default:
|
||||||
return {};
|
return {};
|
||||||
@ -557,11 +557,11 @@ QVariant ResourceFolderModel::headerData(int section, [[maybe_unused]] Qt::Orien
|
|||||||
switch (role) {
|
switch (role) {
|
||||||
case Qt::DisplayRole:
|
case Qt::DisplayRole:
|
||||||
switch (section) {
|
switch (section) {
|
||||||
case ACTIVE_COLUMN:
|
case ActiveColumn:
|
||||||
case NAME_COLUMN:
|
case NameColumn:
|
||||||
case DATE_COLUMN:
|
case DateColumn:
|
||||||
case PROVIDER_COLUMN:
|
case ProviderColumn:
|
||||||
case SIZE_COLUMN:
|
case SizeColumn:
|
||||||
return columnNames().at(section);
|
return columnNames().at(section);
|
||||||
default:
|
default:
|
||||||
return {};
|
return {};
|
||||||
@ -569,15 +569,15 @@ QVariant ResourceFolderModel::headerData(int section, [[maybe_unused]] Qt::Orien
|
|||||||
case Qt::ToolTipRole: {
|
case Qt::ToolTipRole: {
|
||||||
//: Here, resource is a generic term for external resources, like Mods, Resource Packs, Shader Packs, etc.
|
//: Here, resource is a generic term for external resources, like Mods, Resource Packs, Shader Packs, etc.
|
||||||
switch (section) {
|
switch (section) {
|
||||||
case ACTIVE_COLUMN:
|
case ActiveColumn:
|
||||||
return tr("Is the resource enabled?");
|
return tr("Is the resource enabled?");
|
||||||
case NAME_COLUMN:
|
case NameColumn:
|
||||||
return tr("The name of the resource.");
|
return tr("The name of the resource.");
|
||||||
case DATE_COLUMN:
|
case DateColumn:
|
||||||
return tr("The date and time this resource was last changed (or added).");
|
return tr("The date and time this resource was last changed (or added).");
|
||||||
case PROVIDER_COLUMN:
|
case ProviderColumn:
|
||||||
return tr("The source provider of the resource.");
|
return tr("The source provider of the resource.");
|
||||||
case SIZE_COLUMN:
|
case SizeColumn:
|
||||||
return tr("The size of the resource.");
|
return tr("The size of the resource.");
|
||||||
default:
|
default:
|
||||||
return {};
|
return {};
|
||||||
|
@ -151,7 +151,7 @@ class ResourceFolderModel : public QAbstractListModel {
|
|||||||
/* Qt behavior */
|
/* Qt behavior */
|
||||||
|
|
||||||
/* Basic columns */
|
/* Basic columns */
|
||||||
enum Columns { ACTIVE_COLUMN = 0, NAME_COLUMN, DATE_COLUMN, PROVIDER_COLUMN, SIZE_COLUMN, NUM_COLUMNS };
|
enum Columns { ActiveColumn = 0, NameColumn, DateColumn, ProviderColumn, SizeColumn, NUM_COLUMNS };
|
||||||
|
|
||||||
QStringList columnNames(bool translated = true) const { return translated ? m_column_names_translated : m_column_names; }
|
QStringList columnNames(bool translated = true) const { return translated ? m_column_names_translated : m_column_names; }
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user