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
|
* @return if the cache size was increased
|
||||||
*/
|
*/
|
||||||
bool _markCacheMissByEviciton()
|
bool _markCacheMissByEviciton()
|
||||||
|
@ -206,7 +206,7 @@ void Mod::finishResolvingWithDetails(ModDetails&& details)
|
|||||||
if (!iconPath().isEmpty()) {
|
if (!iconPath().isEmpty()) {
|
||||||
m_pack_image_cache_key.was_read_attempt = false;
|
m_pack_image_cache_key.was_read_attempt = false;
|
||||||
}
|
}
|
||||||
};
|
}
|
||||||
|
|
||||||
auto Mod::provider() const -> std::optional<QString>
|
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...";
|
qDebug() << "Mod" << name() << "Had it's icon evicted form the cache. reloading...";
|
||||||
PixmapCache::markCacheMissByEviciton();
|
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;
|
m_pack_image_cache_key.was_read_attempt = true;
|
||||||
ModUtils::loadIconFile(*this);
|
ModUtils::loadIconFile(*this);
|
||||||
return icon(size);
|
return icon(size);
|
||||||
|
@ -158,12 +158,10 @@ QVariant ResourcePackFolderModel::headerData(int section, Qt::Orientation orient
|
|||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
case Qt::SizeHintRole:
|
case Qt::SizeHintRole:
|
||||||
switch (section) {
|
if (section == ImageColumn) {
|
||||||
case ImageColumn:
|
return QSize(64,0);
|
||||||
return QSize(64,0);
|
|
||||||
default:
|
|
||||||
return {};
|
|
||||||
}
|
}
|
||||||
|
return {};
|
||||||
default:
|
default:
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
|
@ -101,12 +101,10 @@ QVariant TexturePackFolderModel::data(const QModelIndex& index, int role) const
|
|||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
case Qt::CheckStateRole:
|
case Qt::CheckStateRole:
|
||||||
switch (column) {
|
if (column == ActiveColumn) {
|
||||||
case ActiveColumn:
|
return m_resources[row]->enabled() ? Qt::Checked : Qt::Unchecked;
|
||||||
return m_resources[row]->enabled() ? Qt::Checked : Qt::Unchecked;
|
|
||||||
default:
|
|
||||||
return {};
|
|
||||||
}
|
}
|
||||||
|
return {};
|
||||||
default:
|
default:
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
|
@ -268,12 +268,12 @@ ModDetails ReadFabricModInfo(QByteArray contents)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (largest > 0) {
|
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();
|
details.icon_file = obj.value(key).toString();
|
||||||
} else { // parsing the sizes failed
|
} else { // parsing the sizes failed
|
||||||
// take the first
|
// take the first
|
||||||
for (auto icon : obj) {
|
for (auto i : obj) {
|
||||||
details.icon_file = icon.toString();
|
details.icon_file = i.toString();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -355,12 +355,12 @@ ModDetails ReadQuiltModInfo(QByteArray contents)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (largest > 0) {
|
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();
|
details.icon_file = obj.value(key).toString();
|
||||||
} else { // parsing the sizes failed
|
} else { // parsing the sizes failed
|
||||||
// take the first
|
// take the first
|
||||||
for (auto icon : obj) {
|
for (auto i : obj) {
|
||||||
details.icon_file = icon.toString();
|
details.icon_file = i.toString();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user