KMyMoney 是一款优秀的个人财务软件,从 5.0 开始官方打包了 macOS 下的安装包,非常方便,但在图标显示上有个小 bug:
![893abfb7fa7aa1704dbc1090b0c11156.png](https://img-blog.csdnimg.cn/img_convert/893abfb7fa7aa1704dbc1090b0c11156.png)
这个 bug 的原因是这样的,在 kmymoney.cpp 文件这行:
{
const auto customIconRelativePath = QString(QStringLiteral("icons/hicolor/16x16/actions/account-add.png"));
#ifndef IS_APPIMAGE
// find where our custom icons were installed based on an custom icon that we know should exist after installation
auto customIconAbsolutePath = QStandardPaths::locate(QStandardPaths::AppDataLocation, customIconRelativePath);
if (customIconAbsolutePath.isEmpty()) {
qWarning("Custom icons were not found in any of the following QStandardPaths::AppDataLocation:");
for (const auto &standardPath : QStandardPaths::standardLocations(QStandardPaths::AppDataLocation))
qWarning() << standardPath;
}
KMyMoney 在 macOS 下会在这三个目录寻找 "icons/hicolor/..." 文件:
- ~/Library/Application Support/kmymoney
- /Library/Application Support/kmymoney
- /Applications/kmymoney.app/Contents/Resources/
但是这个 "icons/hicolor" 位于 /Applications/kmymoney.app/Contents/Resources/kmymoney 下,多了末尾的 "/kmymoney",于是 KMyMoney 使用了 Qt5 的默认图标主题搜索路径 QIcon::themeSearchPaths()
,这个路径列表里是找不到所需的图标的。
临时绕过去的办法是 ln -snf /Applications/kmymoney.app/Contents/Resources/kmymoney ~/Library/Application Support/kmymoney
。
另外从 KMyMoney 代码里看,它对 macOS 下的主题支持也很不完善,写死了只支持 system 主题。
在 https://bugs.kde.org/ 有帐号的同学汇报下吧,懒得注册帐号了。
「更新」:官方已经修正了这个问题:
https://github.com/KDE/kmymoney/commit/9b92214d03e4763fdad3f095be9bd64b7adab378github.com