diff options
author | Rachel Powers <508861+Ryex@users.noreply.github.com> | 2023-05-28 13:00:08 -0700 |
---|---|---|
committer | Rachel Powers <508861+Ryex@users.noreply.github.com> | 2023-05-28 13:00:08 -0700 |
commit | 4eb9083ddc3c57f45d252ceae18d3e9dbf4ee4a3 (patch) | |
tree | 3afed793299f611462a316a0ac7861a178f7bf04 /launcher/minecraft/mod/ResourceFolderModel.h | |
parent | b28f682ad9726c536f49579a3bd810cacc6e45ef (diff) | |
download | PrismLauncher-4eb9083ddc3c57f45d252ceae18d3e9dbf4ee4a3.tar.gz PrismLauncher-4eb9083ddc3c57f45d252ceae18d3e9dbf4ee4a3.tar.bz2 PrismLauncher-4eb9083ddc3c57f45d252ceae18d3e9dbf4ee4a3.zip |
refactor: column names as class property, use string names in setting
Signed-off-by: Rachel Powers <508861+Ryex@users.noreply.github.com>
Diffstat (limited to 'launcher/minecraft/mod/ResourceFolderModel.h')
-rw-r--r-- | launcher/minecraft/mod/ResourceFolderModel.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/launcher/minecraft/mod/ResourceFolderModel.h b/launcher/minecraft/mod/ResourceFolderModel.h index e1dc685b..138815cf 100644 --- a/launcher/minecraft/mod/ResourceFolderModel.h +++ b/launcher/minecraft/mod/ResourceFolderModel.h @@ -97,6 +97,7 @@ class ResourceFolderModel : public QAbstractListModel { /* Basic columns */ enum Columns { ACTIVE_COLUMN = 0, NAME_COLUMN, DATE_COLUMN, NUM_COLUMNS }; + QStringList columnNames(bool translated = true) const { return translated ? m_column_names_translated : m_column_names; }; [[nodiscard]] int rowCount(const QModelIndex& parent = {}) const override { return parent.isValid() ? 0 : static_cast<int>(size()); } [[nodiscard]] int columnCount(const QModelIndex& parent = {}) const override { return parent.isValid() ? 0 : NUM_COLUMNS; }; @@ -198,6 +199,8 @@ class ResourceFolderModel : public QAbstractListModel { // Represents the relationship between a column's index (represented by the list index), and it's sorting key. // As such, the order in with they appear is very important! QList<SortType> m_column_sort_keys = { SortType::ENABLED, SortType::NAME, SortType::DATE }; + QStringList m_column_names = {"Enable", "Name", "Last Modified"}; + QStringList m_column_names_translated = {tr("Enable"), tr("Name"), tr("Last Modified")}; QList<QHeaderView::ResizeMode> m_column_resize_modes = { QHeaderView::Stretch, QHeaderView::ResizeToContents, QHeaderView::ResizeToContents }; bool m_can_interact = true; |