aboutsummaryrefslogtreecommitdiff
path: root/launcher/minecraft/mod/ResourceFolderModel.cpp
diff options
context:
space:
mode:
authorTrial97 <alexandru.tripon97@gmail.com>2023-08-17 14:23:37 +0300
committerTrial97 <alexandru.tripon97@gmail.com>2023-08-17 14:23:37 +0300
commit4a1d85f99913d0bacf8cdd118c81401378c758b6 (patch)
treee8389ba64e1b1a303545f1dad242c9a9124ddca9 /launcher/minecraft/mod/ResourceFolderModel.cpp
parent939a2d67ed75be714e9f3b1b918250d006b3860a (diff)
parent85f36ebed7e1295547cd2324d1baf7834be89c31 (diff)
downloadPrismLauncher-4a1d85f99913d0bacf8cdd118c81401378c758b6.tar.gz
PrismLauncher-4a1d85f99913d0bacf8cdd118c81401378c758b6.tar.bz2
PrismLauncher-4a1d85f99913d0bacf8cdd118c81401378c758b6.zip
Merge branch 'develop' of https://github.com/PrismLauncher/PrismLauncher into develop
Diffstat (limited to 'launcher/minecraft/mod/ResourceFolderModel.cpp')
-rw-r--r--launcher/minecraft/mod/ResourceFolderModel.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/launcher/minecraft/mod/ResourceFolderModel.cpp b/launcher/minecraft/mod/ResourceFolderModel.cpp
index 0106d5c9..d3237b34 100644
--- a/launcher/minecraft/mod/ResourceFolderModel.cpp
+++ b/launcher/minecraft/mod/ResourceFolderModel.cpp
@@ -447,7 +447,7 @@ QVariant ResourceFolderModel::data(const QModelIndex& index, int role) const
}
}
-bool ResourceFolderModel::setData(const QModelIndex& index, const QVariant& value, int role)
+bool ResourceFolderModel::setData(const QModelIndex& index, [[maybe_unused]] const QVariant& value, int role)
{
int row = index.row();
if (row < 0 || row >= rowCount(index.parent()) || !index.isValid())
@@ -471,7 +471,7 @@ bool ResourceFolderModel::setData(const QModelIndex& index, const QVariant& valu
return false;
}
-QVariant ResourceFolderModel::headerData(int section, Qt::Orientation orientation, int role) const
+QVariant ResourceFolderModel::headerData(int section, [[maybe_unused]] Qt::Orientation orientation, int role) const
{
switch (role) {
case Qt::DisplayRole:
@@ -551,6 +551,9 @@ QMenu* ResourceFolderModel::createHeaderContextMenu(QTreeView* tree)
menu->addSeparator()->setText(tr("Show / Hide Columns"));
for (int col = 0; col < columnCount(); ++col) {
+ // Skip creating actions for columns that should not be hidden
+ if (!m_columnsHideable.at(col))
+ continue;
auto act = new QAction(menu);
setupHeaderAction(act, col);
@@ -584,7 +587,8 @@ SortType ResourceFolderModel::columnToSortKey(size_t column) const
}
/* Standard Proxy Model for createFilterProxyModel */
-[[nodiscard]] bool ResourceFolderModel::ProxyModel::filterAcceptsRow(int source_row, const QModelIndex& source_parent) const
+[[nodiscard]] bool ResourceFolderModel::ProxyModel::filterAcceptsRow(int source_row,
+ [[maybe_unused]] const QModelIndex& source_parent) const
{
auto* model = qobject_cast<ResourceFolderModel*>(sourceModel());
if (!model)