mirror of
https://github.com/PrismLauncher/PrismLauncher.git
synced 2026-07-01 19:06:58 +03:00
chore(clang-tidy): modernize the code
Signed-off-by: Trial97 <alexandru.tripon97@gmail.com>
This commit is contained in:
parent
18f04b1e29
commit
9c88eb9bc0
36 changed files with 713 additions and 632 deletions
|
|
@ -320,9 +320,9 @@ bool ResourceFolderModel::setResourceEnabled(const QModelIndexList& indexes, Ena
|
|||
return succeeded;
|
||||
}
|
||||
|
||||
static QMutex s_update_task_mutex;
|
||||
bool ResourceFolderModel::update()
|
||||
{
|
||||
static QMutex s_update_task_mutex;
|
||||
// We hold a lock here to prevent race conditions on the m_current_update_task reset.
|
||||
QMutexLocker lock(&s_update_task_mutex);
|
||||
|
||||
|
|
@ -371,7 +371,7 @@ bool ResourceFolderModel::update()
|
|||
return true;
|
||||
}
|
||||
|
||||
void ResourceFolderModel::resolveResource(Resource::Ptr res)
|
||||
void ResourceFolderModel::resolveResource(const Resource::Ptr& res)
|
||||
{
|
||||
if (!res->shouldResolve()) {
|
||||
return;
|
||||
|
|
@ -597,6 +597,7 @@ QVariant ResourceFolderModel::data(const QModelIndex& index, int role) const
|
|||
if (column == ActiveColumn) {
|
||||
return m_resources[row]->enabled() ? Qt::Checked : Qt::Unchecked;
|
||||
}
|
||||
[[fallthrough]];
|
||||
case Qt::UserRole:
|
||||
if (column == LockUpdateCoumn) {
|
||||
return at(row).lockUpdate();
|
||||
|
|
@ -669,7 +670,7 @@ QVariant ResourceFolderModel::headerData(int section, [[maybe_unused]] Qt::Orien
|
|||
return {};
|
||||
}
|
||||
|
||||
void ResourceFolderModel::setupHeaderAction(QAction* act, int column)
|
||||
void ResourceFolderModel::setupHeaderAction(QAction* act, int column) const
|
||||
{
|
||||
Q_ASSERT(act);
|
||||
|
||||
|
|
@ -798,7 +799,7 @@ QSortFilterProxyModel* ResourceFolderModel::createFilterProxyModel(QObject* pare
|
|||
SortType ResourceFolderModel::columnToSortKey(size_t column) const
|
||||
{
|
||||
Q_ASSERT(m_columnSortKeys.size() == columnCount());
|
||||
return m_columnSortKeys.at(column);
|
||||
return m_columnSortKeys.at(static_cast<qsizetype>(column));
|
||||
}
|
||||
|
||||
/* Standard Proxy Model for createFilterProxyModel */
|
||||
|
|
@ -1004,14 +1005,16 @@ QList<Resource*> ResourceFolderModel::selectedResources(const QModelIndexList& i
|
|||
|
||||
bool ResourceFolderModel::setModUpdate(const QModelIndexList& indexes, EnableAction action)
|
||||
{
|
||||
if (indexes.isEmpty())
|
||||
if (indexes.isEmpty()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
bool succeeded = true;
|
||||
auto updateColumn = columnNames(false).indexOf("Update");
|
||||
auto updateColumn = static_cast<int>(columnNames(false).indexOf("Update"));
|
||||
for (const auto& idx : indexes) {
|
||||
if (!validateIndex(idx) || idx.column() != updateColumn)
|
||||
if (!validateIndex(idx) || idx.column() != updateColumn) {
|
||||
continue;
|
||||
}
|
||||
|
||||
int row = idx.row();
|
||||
auto& resource = m_resources[row];
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue