From 4eb9083ddc3c57f45d252ceae18d3e9dbf4ee4a3 Mon Sep 17 00:00:00 2001 From: Rachel Powers <508861+Ryex@users.noreply.github.com> Date: Sun, 28 May 2023 13:00:08 -0700 Subject: refactor: column names as class property, use string names in setting Signed-off-by: Rachel Powers <508861+Ryex@users.noreply.github.com> --- launcher/minecraft/mod/TexturePackFolderModel.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'launcher/minecraft/mod/TexturePackFolderModel.cpp') diff --git a/launcher/minecraft/mod/TexturePackFolderModel.cpp b/launcher/minecraft/mod/TexturePackFolderModel.cpp index 76145b3b..898d128f 100644 --- a/launcher/minecraft/mod/TexturePackFolderModel.cpp +++ b/launcher/minecraft/mod/TexturePackFolderModel.cpp @@ -45,6 +45,8 @@ 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::ResizeToContents, QHeaderView::Stretch, QHeaderView::ResizeToContents}; @@ -118,13 +120,10 @@ QVariant TexturePackFolderModel::headerData(int section, Qt::Orientation orienta case Qt::DisplayRole: switch (section) { case ActiveColumn: - return tr("Enable"); case NameColumn: - return tr("Name"); case DateColumn: - return tr("Last modified"); case ImageColumn: - return tr("Image"); + return columnNames().at(section); default: return {}; } -- cgit