diff --git a/src/appdelegate.cpp b/src/appdelegate.cpp
index 83649e8..d4b70f0 100644
--- a/src/appdelegate.cpp
+++ b/src/appdelegate.cpp
@@ -94,7 +94,7 @@ void AppDelegate::paint(QPainter *painter, const QStyleOptionViewItem &option, c
QString finalIconPath = iconPath;
qDebug() << "原始图标路径:" << iconPath;
if (iconPath.isEmpty() || !QFile::exists(iconPath)) {
- finalIconPath = ":/resources/default_icon.svg";
+ finalIconPath = ":/resources/default_icon.png";
qDebug() << "图标文件不存在,使用默认图标:" << finalIconPath;
} else {
qDebug() << "使用图标文件:" << finalIconPath;
@@ -103,7 +103,7 @@ void AppDelegate::paint(QPainter *painter, const QStyleOptionViewItem &option, c
// 额外检查资源文件是否存在
if (finalIconPath.startsWith(":/") && QIcon(finalIconPath).isNull()) {
qDebug() << "资源图标无法加载,使用备用默认图标";
- finalIconPath = ":/resources/default_icon.svg";
+ finalIconPath = ":/resources/default_icon.png";
}
// 如果是忽略状态,绘制灰色图标
diff --git a/src/aptssupdater.cpp b/src/aptssupdater.cpp
index 3a5b5bb..8dcde53 100644
--- a/src/aptssupdater.cpp
+++ b/src/aptssupdater.cpp
@@ -241,7 +241,7 @@ QStringList aptssUpdater::getPackageIcons()
QProcess dpkgProcess; // 在循环内部创建新的QProcess实例
QString packageName = package.split(":")[0];
- QString iconPath = ":/resources/default_icon.svg"; // 默认图标
+ QString iconPath = ":/resources/default_icon.png"; // 默认图标
// 获取包文件列表
dpkgProcess.start("dpkg", QStringList() << "-L" << packageName);
@@ -298,7 +298,7 @@ QStringList aptssUpdater::getPackageIcons()
}
// 如果.desktop中没有找到图标,尝试直接查找包中的图标文件
- if (iconPath == ":/resources/default_icon.svg") {
+ if (iconPath == ":/resources/default_icon.png") {
qDebug() << "未在.desktop文件中找到图标,尝试直接查找包中的图标文件";
QStringList iconFiles = files.filter(QRegularExpression("/(usr/share/pixmaps|usr/share/icons|opt/apps/.*/entries/icons)/.*\\.(png|svg)$"));
if (!iconFiles.isEmpty()) {
diff --git a/src/icons.qrc b/src/icons.qrc
index f81e1f8..9bbc9d3 100644
--- a/src/icons.qrc
+++ b/src/icons.qrc
@@ -4,5 +4,6 @@
../resources/default_icon.svg
../resources/spark-update-tool.svg
../resources/128*128/spark-update-tool.png
+ ../resources/default_icon.png