Revert unwise refactor

Signed-off-by: TheKodeToad <TheKodeToad@proton.me>
This commit is contained in:
TheKodeToad
2024-10-28 20:42:59 +00:00
parent 2b22a1aebe
commit ad1d5ddcdf
2 changed files with 18 additions and 18 deletions

View File

@ -483,19 +483,19 @@ QVariant ResourceFolderModel::data(const QModelIndex& index, int role) const
switch (role) {
case Qt::DisplayRole:
switch (column) {
case NAME_COLUMN:
case NameColumn:
return m_resources[row]->name();
case DATE_COLUMN:
case DateColumn:
return m_resources[row]->dateTimeChanged();
case PROVIDER_COLUMN:
case ProviderColumn:
return m_resources[row]->provider();
case SIZE_COLUMN:
case SizeColumn:
return m_resources[row]->sizeStr();
default:
return {};
}
case Qt::ToolTipRole:
if (column == NAME_COLUMN) {
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."
@ -511,14 +511,14 @@ QVariant ResourceFolderModel::data(const QModelIndex& index, int role) const
return m_resources[row]->internal_id();
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 {};
}
case Qt::CheckStateRole:
switch (column) {
case ACTIVE_COLUMN:
case ActiveColumn:
return m_resources[row]->enabled() ? Qt::Checked : Qt::Unchecked;
default:
return {};
@ -557,11 +557,11 @@ QVariant ResourceFolderModel::headerData(int section, [[maybe_unused]] Qt::Orien
switch (role) {
case Qt::DisplayRole:
switch (section) {
case ACTIVE_COLUMN:
case NAME_COLUMN:
case DATE_COLUMN:
case PROVIDER_COLUMN:
case SIZE_COLUMN:
case ActiveColumn:
case NameColumn:
case DateColumn:
case ProviderColumn:
case SizeColumn:
return columnNames().at(section);
default:
return {};
@ -569,15 +569,15 @@ QVariant ResourceFolderModel::headerData(int section, [[maybe_unused]] Qt::Orien
case Qt::ToolTipRole: {
//: Here, resource is a generic term for external resources, like Mods, Resource Packs, Shader Packs, etc.
switch (section) {
case ACTIVE_COLUMN:
case ActiveColumn:
return tr("Is the resource enabled?");
case NAME_COLUMN:
case NameColumn:
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).");
case PROVIDER_COLUMN:
case ProviderColumn:
return tr("The source provider of the resource.");
case SIZE_COLUMN:
case SizeColumn:
return tr("The size of the resource.");
default:
return {};