Replace getThemedIcon with QIcon::fromTheme/APPLICATION->logo() (#4156)
This commit is contained in:
@@ -123,7 +123,7 @@ bool createInstanceShortcut(const Shortcut& shortcut, const QString& filePath)
|
||||
|
||||
// part of fix for weird bug involving the window icon being replaced
|
||||
// dunno why it happens, but parent 2-line fix seems to be enough, so w/e
|
||||
auto appIcon = APPLICATION->getThemedIcon("logo");
|
||||
auto appIcon = APPLICATION->logo();
|
||||
|
||||
QFile iconFile(iconPath);
|
||||
if (!iconFile.open(QFile::WriteOnly)) {
|
||||
|
||||
@@ -42,7 +42,6 @@
|
||||
#include <QIcon>
|
||||
#include <QStyle>
|
||||
|
||||
#include "Application.h"
|
||||
#include "Version.h"
|
||||
|
||||
#include "minecraft/mod/tasks/LocalDataPackParseTask.h"
|
||||
@@ -92,7 +91,7 @@ QVariant DataPackFolderModel::data(const QModelIndex& index, int role) const
|
||||
}
|
||||
case Qt::DecorationRole: {
|
||||
if (column == NameColumn && (at(row).isSymLinkUnder(instDirPath()) || at(row).isMoreThanOneHardLink()))
|
||||
return APPLICATION->getThemedIcon("status-yellow");
|
||||
return QIcon::fromTheme("status-yellow");
|
||||
if (column == ImageColumn) {
|
||||
return at(row).image({ 32, 32 }, Qt::AspectRatioMode::KeepAspectRatioByExpanding);
|
||||
}
|
||||
|
||||
@@ -49,8 +49,6 @@
|
||||
#include <QUrl>
|
||||
#include <QUuid>
|
||||
|
||||
#include "Application.h"
|
||||
|
||||
#include "minecraft/mod/tasks/LocalModParseTask.h"
|
||||
|
||||
ModFolderModel::ModFolderModel(const QDir& dir, BaseInstance* instance, bool is_indexed, bool create_dir, QObject* parent)
|
||||
@@ -132,7 +130,7 @@ QVariant ModFolderModel::data(const QModelIndex& index, int role) const
|
||||
return m_resources[row]->internal_id();
|
||||
case Qt::DecorationRole: {
|
||||
if (column == NameColumn && (at(row).isSymLinkUnder(instDirPath()) || at(row).isMoreThanOneHardLink()))
|
||||
return APPLICATION->getThemedIcon("status-yellow");
|
||||
return QIcon::fromTheme("status-yellow");
|
||||
if (column == ImageColumn) {
|
||||
return at(row).icon({ 32, 32 }, Qt::AspectRatioMode::KeepAspectRatioByExpanding);
|
||||
}
|
||||
|
||||
@@ -503,7 +503,7 @@ QVariant ResourceFolderModel::data(const QModelIndex& index, int role) const
|
||||
return m_resources[row]->internal_id();
|
||||
case Qt::DecorationRole: {
|
||||
if (column == NameColumn && (at(row).isSymLinkUnder(instDirPath()) || at(row).isMoreThanOneHardLink()))
|
||||
return APPLICATION->getThemedIcon("status-yellow");
|
||||
return QIcon::fromTheme("status-yellow");
|
||||
|
||||
return {};
|
||||
}
|
||||
@@ -709,8 +709,7 @@ SortType ResourceFolderModel::columnToSortKey(size_t column) const
|
||||
}
|
||||
|
||||
/* Standard Proxy Model for createFilterProxyModel */
|
||||
bool ResourceFolderModel::ProxyModel::filterAcceptsRow(int source_row,
|
||||
[[maybe_unused]] const QModelIndex& source_parent) const
|
||||
bool ResourceFolderModel::ProxyModel::filterAcceptsRow(int source_row, [[maybe_unused]] const QModelIndex& source_parent) const
|
||||
{
|
||||
auto* model = qobject_cast<ResourceFolderModel*>(sourceModel());
|
||||
if (!model)
|
||||
|
||||
@@ -41,7 +41,6 @@
|
||||
#include <QIcon>
|
||||
#include <QStyle>
|
||||
|
||||
#include "Application.h"
|
||||
#include "Version.h"
|
||||
|
||||
#include "minecraft/mod/tasks/LocalDataPackParseTask.h"
|
||||
@@ -96,7 +95,7 @@ QVariant ResourcePackFolderModel::data(const QModelIndex& index, int role) const
|
||||
}
|
||||
case Qt::DecorationRole: {
|
||||
if (column == NameColumn && (at(row).isSymLinkUnder(instDirPath()) || at(row).isMoreThanOneHardLink()))
|
||||
return APPLICATION->getThemedIcon("status-yellow");
|
||||
return QIcon::fromTheme("status-yellow");
|
||||
if (column == ImageColumn) {
|
||||
return at(row).image({ 32, 32 }, Qt::AspectRatioMode::KeepAspectRatioByExpanding);
|
||||
}
|
||||
|
||||
@@ -33,10 +33,6 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
#include <QCoreApplication>
|
||||
|
||||
#include "Application.h"
|
||||
|
||||
#include "TexturePackFolderModel.h"
|
||||
|
||||
#include "minecraft/mod/tasks/LocalTexturePackParseTask.h"
|
||||
@@ -98,7 +94,7 @@ QVariant TexturePackFolderModel::data(const QModelIndex& index, int role) const
|
||||
return m_resources[row]->internal_id();
|
||||
case Qt::DecorationRole: {
|
||||
if (column == NameColumn && (at(row).isSymLinkUnder(instDirPath()) || at(row).isMoreThanOneHardLink()))
|
||||
return APPLICATION->getThemedIcon("status-yellow");
|
||||
return QIcon::fromTheme("status-yellow");
|
||||
if (column == ImageColumn) {
|
||||
return at(row).image({ 32, 32 }, Qt::AspectRatioMode::KeepAspectRatioByExpanding);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user