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
|
|
@ -36,28 +36,30 @@
|
|||
#include "TexturePackFolderModel.h"
|
||||
|
||||
#include "minecraft/mod/tasks/LocalTexturePackParseTask.h"
|
||||
#include "minecraft/mod/tasks/ResourceFolderLoadTask.h"
|
||||
|
||||
TexturePackFolderModel::TexturePackFolderModel(const QDir& dir, BaseInstance* instance, bool is_indexed, bool create_dir, QObject* parent)
|
||||
: ResourceFolderModel(QDir(dir), instance, is_indexed, create_dir, parent)
|
||||
TexturePackFolderModel::TexturePackFolderModel(const QDir& dir, BaseInstance* instance, bool isIndexed, bool createDir, QObject* parent)
|
||||
: ResourceFolderModel(QDir(dir), instance, isIndexed, createDir, parent)
|
||||
{
|
||||
m_column_names = QStringList({ "Enable", "Image", "Name", "Last Modified", "Provider", "Size", "File Name" });
|
||||
m_column_names_translated = QStringList({ tr("Enable"), tr("Image"), tr("Name"), tr("Last Modified"), tr("Provider"), tr("Size"), tr("File Name") });
|
||||
m_column_sort_keys = { SortType::ENABLED, SortType::NAME, SortType::NAME, 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 };
|
||||
m_columnNames = QStringList({ "Enable", "Image", "Name", "Last Modified", "Provider", "Size", "File Name" });
|
||||
m_columnNamesTranslated =
|
||||
QStringList({ tr("Enable"), tr("Image"), tr("Name"), tr("Last Modified"), tr("Provider"), tr("Size"), tr("File Name") });
|
||||
m_columnSortKeys = { SortType::Enabled, SortType::Name, SortType::Name, SortType::Date,
|
||||
SortType::Provider, SortType::Size, SortType::Filename };
|
||||
m_columnResizeModes = { QHeaderView::Interactive, QHeaderView::Interactive, QHeaderView::Stretch, QHeaderView::Interactive,
|
||||
QHeaderView::Interactive, QHeaderView::Interactive, QHeaderView::Interactive };
|
||||
m_columnsHideable = { false, true, false, true, true, true, true };
|
||||
}
|
||||
|
||||
Task* TexturePackFolderModel::createParseTask(Resource& resource)
|
||||
{
|
||||
return new LocalTexturePackParseTask(m_next_resolution_ticket, static_cast<TexturePack&>(resource));
|
||||
return new LocalTexturePackParseTask(m_nextResolutionTicket, static_cast<TexturePack&>(resource));
|
||||
}
|
||||
|
||||
QVariant TexturePackFolderModel::data(const QModelIndex& index, int role) const
|
||||
{
|
||||
if (!validateIndex(index))
|
||||
if (!validateIndex(index)) {
|
||||
return {};
|
||||
}
|
||||
|
||||
int row = index.row();
|
||||
int column = index.column();
|
||||
|
|
@ -76,6 +78,8 @@ QVariant TexturePackFolderModel::data(const QModelIndex& index, int role) const
|
|||
return QSize(32, 32);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
// map the columns to the base equivilents
|
||||
|
|
@ -99,6 +103,8 @@ QVariant TexturePackFolderModel::data(const QModelIndex& index, int role) const
|
|||
case FileNameColumn:
|
||||
mappedIndex = index.siblingAtColumn(ResourceFolderModel::FileNameColumn);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
if (mappedIndex.isValid()) {
|
||||
|
|
@ -151,5 +157,5 @@ QVariant TexturePackFolderModel::headerData(int section, [[maybe_unused]] Qt::Or
|
|||
|
||||
int TexturePackFolderModel::columnCount(const QModelIndex& parent) const
|
||||
{
|
||||
return parent.isValid() ? 0 : NUM_COLUMNS;
|
||||
return parent.isValid() ? 0 : NumColumns;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue