Fix missing icons on macOS

This commit is contained in:
Weixuan Xiao 2020-04-16 22:05:48 +00:00 committed by Aleix Pol Gonzalez
parent 03a1357a24
commit dc8a2cf5f4
2 changed files with 8 additions and 2 deletions

View file

@ -10,6 +10,12 @@ else()
list(APPEND APP_ICONS sc-apps-kdeconnectindicatordark.svg)
endif()
if(APPLE)
# Craft adds share/icons into blacklist, which will not be copied into the bundle
# As a workaround, on macOS, set ICON_INSTALL_DIR to another path
set(ICON_INSTALL_DIR share/kdeconnect-icons)
endif()
ecm_install_icons(
ICONS
${APP_ICONS}

View file

@ -61,7 +61,7 @@ void IndicatorHelper::postInit()
void IndicatorHelper::iconPathHook()
{
const QString iconPath = QStandardPaths::locate(QStandardPaths::AppDataLocation, QStringLiteral("icons"), QStandardPaths::LocateDirectory);
const QString iconPath = QStandardPaths::locate(QStandardPaths::AppDataLocation, QStringLiteral("kdeconnect-icons"), QStandardPaths::LocateDirectory);
if (!iconPath.isNull()) {
QStringList themeSearchPaths = QIcon::themeSearchPaths();
themeSearchPaths << iconPath;
@ -134,7 +134,7 @@ void IndicatorHelper::systrayIconHook(QSystemTrayIcon &systray)
#else
void IndicatorHelper::systrayIconHook(KStatusNotifierItem &systray)
{
const QString iconPath = QStandardPaths::locate(QStandardPaths::AppDataLocation, QStringLiteral("icons"), QStandardPaths::LocateDirectory);
const QString iconPath = QStandardPaths::locate(QStandardPaths::AppDataLocation, QStringLiteral("kdeconnect-icons"), QStandardPaths::LocateDirectory);
if (!iconPath.isNull()) {
systray.setIconByName(QStringLiteral("kdeconnectindicatordark"));
} else {