Skip to content

Commit

Permalink
Fix compile errors when building snap package
Browse files Browse the repository at this point in the history
* System icons are no longer used eliminating the need to differentiate behavior for the snap package on Linux.
  • Loading branch information
droidmonkey committed Mar 6, 2020
1 parent 557736e commit e26063a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 28 deletions.
6 changes: 0 additions & 6 deletions src/core/Bootstrap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,12 +85,6 @@ namespace Bootstrap
bootstrap();
MessageBox::initializeButtonDefs();

#ifdef KEEPASSXC_DIST_SNAP
// snap: force fallback theme to avoid using system theme (gtk integration)
// with missing actions just like on Windows and macOS
QIcon::setThemeSearchPaths(QStringList() << ":/icons");
#endif

#ifdef Q_OS_MACOS
// Don't show menu icons on OSX
QApplication::setAttribute(Qt::AA_DontShowIconsInMenus);
Expand Down
24 changes: 2 additions & 22 deletions src/core/FilePath.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -97,42 +97,22 @@ QString FilePath::wordlistPath(const QString& name)

QIcon FilePath::applicationIcon()
{
#ifdef KEEPASSXC_DIST_SNAP
return icon("apps", "keepassxc", false);
#else
return icon("apps", "keepassxc", false);
#endif
}

QIcon FilePath::trayIcon()
{
bool darkIcon = useDarkIcon();

#ifdef KEEPASSXC_DIST_SNAP
return (darkIcon) ? icon("apps", "keepassxc-dark", false) : icon("apps", "keepassxc", false);
#else
return (darkIcon) ? icon("apps", "keepassxc-dark", false) : icon("apps", "keepassxc", false);
#endif
return useDarkIcon() ? icon("apps", "keepassxc-dark", false) : icon("apps", "keepassxc", false);
}

QIcon FilePath::trayIconLocked()
{
#ifdef KEEPASSXC_DIST_SNAP
return icon("apps", "keepassxc-locked", false);
#else
return icon("apps", "keepassxc-locked", false);
#endif
}

QIcon FilePath::trayIconUnlocked()
{
bool darkIcon = useDarkIcon();

#ifdef KEEPASSXC_DIST_SNAP
return darkIcon ? icon("apps", "keepassxc-dark", false) : icon("apps", "keepassxc-unlocked", false);
#else
return darkIcon ? icon("apps", "keepassxc-dark", false) : icon("apps", "keepassxc-unlocked", false);
#endif
return useDarkIcon() ? icon("apps", "keepassxc-dark", false) : icon("apps", "keepassxc-unlocked", false);
}

QIcon FilePath::icon(const QString& category, const QString& name, bool recolor)
Expand Down

0 comments on commit e26063a

Please sign in to comment.