fix: fix qchar conversion and codeql

Signed-off-by: Rachel Powers <508861+Ryex@users.noreply.github.com>
This commit is contained in:
Rachel Powers 2023-05-05 11:13:36 -07:00
parent fd7338d3f3
commit 2fe3dc5960
5 changed files with 15 additions and 19 deletions

View File

@ -95,7 +95,7 @@ class PixmapCache final : public QObject {
}
/**
* Mark that a cach miss occured because of a eviciton if too man of these occure to fast the cache size is increased
* Mark that a cache miss occurred because of a eviction if too many of these occur too fast the cache size is increased
* @return if the cache size was increased
*/
bool _markCacheMissByEviciton()

View File

@ -206,7 +206,7 @@ void Mod::finishResolvingWithDetails(ModDetails&& details)
if (!iconPath().isEmpty()) {
m_pack_image_cache_key.was_read_attempt = false;
}
};
}
auto Mod::provider() const -> std::optional<QString>
{
@ -250,7 +250,7 @@ QPixmap Mod::icon(QSize size, Qt::AspectRatioMode mode) const
qDebug() << "Mod" << name() << "Had it's icon evicted form the cache. reloading...";
PixmapCache::markCacheMissByEviciton();
}
// Imaged got evicted from the cache or an attmept to load it has not been made. load it and retry.
// Image got evicted from the cache or an attempt to load it has not been made. load it and retry.
m_pack_image_cache_key.was_read_attempt = true;
ModUtils::loadIconFile(*this);
return icon(size);

View File

@ -158,12 +158,10 @@ QVariant ResourcePackFolderModel::headerData(int section, Qt::Orientation orient
return {};
}
case Qt::SizeHintRole:
switch (section) {
case ImageColumn:
return QSize(64,0);
default:
return {};
if (section == ImageColumn) {
return QSize(64,0);
}
return {};
default:
return {};
}

View File

@ -101,12 +101,10 @@ QVariant TexturePackFolderModel::data(const QModelIndex& index, int role) const
return {};
}
case Qt::CheckStateRole:
switch (column) {
case ActiveColumn:
return m_resources[row]->enabled() ? Qt::Checked : Qt::Unchecked;
default:
return {};
if (column == ActiveColumn) {
return m_resources[row]->enabled() ? Qt::Checked : Qt::Unchecked;
}
return {};
default:
return {};
}

View File

@ -268,12 +268,12 @@ ModDetails ReadFabricModInfo(QByteArray contents)
}
}
if (largest > 0) {
auto key = QString::number(largest) + "x" + largest;
auto key = QString::number(largest) + "x" + QString::number(largest);
details.icon_file = obj.value(key).toString();
} else { // parsing the sizes failed
// take the first
for (auto icon : obj) {
details.icon_file = icon.toString();
for (auto i : obj) {
details.icon_file = i.toString();
break;
}
}
@ -355,12 +355,12 @@ ModDetails ReadQuiltModInfo(QByteArray contents)
}
}
if (largest > 0) {
auto key = QString::number(largest) + "x" + largest;
auto key = QString::number(largest) + "x" + QString::number(largest);
details.icon_file = obj.value(key).toString();
} else { // parsing the sizes failed
// take the first
for (auto icon : obj) {
details.icon_file = icon.toString();
for (auto i : obj) {
details.icon_file = i.toString();
break;
}
}