fix: fix qchar conversion and codeql
Signed-off-by: Rachel Powers <508861+Ryex@users.noreply.github.com>
This commit is contained in:
parent
fd7338d3f3
commit
2fe3dc5960
@ -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()
|
||||
|
@ -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);
|
||||
|
@ -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 {};
|
||||
}
|
||||
|
@ -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 {};
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user