mirror of
https://github.com/PrismLauncher/PrismLauncher.git
synced 2026-06-29 01:54:20 +03:00
chore(clang-tidy): fix clang tidy warnings
Signed-off-by: Trial97 <alexandru.tripon97@gmail.com>
This commit is contained in:
parent
4c9081a934
commit
bac959bc6f
23 changed files with 650 additions and 546 deletions
|
|
@ -39,27 +39,26 @@
|
|||
#include <QIcon>
|
||||
#include <QStyle>
|
||||
|
||||
#include "Version.h"
|
||||
|
||||
#include "minecraft/mod/tasks/LocalDataPackParseTask.h"
|
||||
|
||||
ResourcePackFolderModel::ResourcePackFolderModel(const QDir& dir, BaseInstance* instance, bool is_indexed, bool create_dir, QObject* parent)
|
||||
: ResourceFolderModel(dir, instance, is_indexed, create_dir, parent)
|
||||
ResourcePackFolderModel::ResourcePackFolderModel(const QDir& dir, BaseInstance* instance, bool isIndexed, bool createDir, QObject* parent)
|
||||
: ResourceFolderModel(dir, instance, isIndexed, createDir, parent)
|
||||
{
|
||||
m_column_names = QStringList({ "Enable", "Image", "Name", "Pack Format", "Last Modified", "Provider", "Size", "File Name" });
|
||||
m_column_names_translated = QStringList(
|
||||
m_columnNames = QStringList({ "Enable", "Image", "Name", "Pack Format", "Last Modified", "Provider", "Size", "File Name" });
|
||||
m_columnNamesTranslated = QStringList(
|
||||
{ tr("Enable"), tr("Image"), tr("Name"), tr("Pack Format"), tr("Last Modified"), tr("Provider"), tr("Size"), tr("File Name") });
|
||||
m_column_sort_keys = { SortType::ENABLED, SortType::NAME, SortType::NAME, SortType::PACK_FORMAT,
|
||||
SortType::DATE, SortType::PROVIDER, SortType::SIZE, SortType::FILENAME };
|
||||
m_column_resize_modes = { QHeaderView::Interactive, QHeaderView::Interactive, QHeaderView::Stretch, QHeaderView::Interactive,
|
||||
QHeaderView::Interactive, QHeaderView::Interactive, QHeaderView::Interactive, QHeaderView::Interactive };
|
||||
m_columnSortKeys = { SortType::Enabled, SortType::Name, SortType::Name, SortType::PackFormat,
|
||||
SortType::Date, SortType::Provider, SortType::Size, SortType::Filename };
|
||||
m_columnResizeModes = { QHeaderView::Interactive, QHeaderView::Interactive, QHeaderView::Stretch, QHeaderView::Interactive,
|
||||
QHeaderView::Interactive, QHeaderView::Interactive, QHeaderView::Interactive, QHeaderView::Interactive };
|
||||
m_columnsHideable = { false, true, false, true, true, true, true, true };
|
||||
}
|
||||
|
||||
QVariant ResourcePackFolderModel::data(const QModelIndex& index, int role) const
|
||||
{
|
||||
if (!validateIndex(index))
|
||||
if (!validateIndex(index)) {
|
||||
return {};
|
||||
}
|
||||
|
||||
int row = index.row();
|
||||
int column = index.column();
|
||||
|
|
@ -92,6 +91,8 @@ QVariant ResourcePackFolderModel::data(const QModelIndex& index, int role) const
|
|||
return QSize(32, 32);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
// map the columns to the base equivilents
|
||||
|
|
@ -115,6 +116,8 @@ QVariant ResourcePackFolderModel::data(const QModelIndex& index, int role) const
|
|||
case FileNameColumn:
|
||||
mappedIndex = index.siblingAtColumn(ResourceFolderModel::FileNameColumn);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
if (mappedIndex.isValid()) {
|
||||
|
|
@ -174,10 +177,10 @@ QVariant ResourcePackFolderModel::headerData(int section, [[maybe_unused]] Qt::O
|
|||
|
||||
int ResourcePackFolderModel::columnCount(const QModelIndex& parent) const
|
||||
{
|
||||
return parent.isValid() ? 0 : NUM_COLUMNS;
|
||||
return parent.isValid() ? 0 : NumColumns;
|
||||
}
|
||||
|
||||
Task* ResourcePackFolderModel::createParseTask(Resource& resource)
|
||||
{
|
||||
return new LocalDataPackParseTask(m_next_resolution_ticket, dynamic_cast<ResourcePack*>(&resource));
|
||||
return new LocalDataPackParseTask(m_nextResolutionTicket, dynamic_cast<ResourcePack*>(&resource));
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue