Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/keepassxreboot/keepassxc.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/FilePath.cpp')
-rw-r--r--src/core/FilePath.cpp25
1 files changed, 21 insertions, 4 deletions
diff --git a/src/core/FilePath.cpp b/src/core/FilePath.cpp
index b5c9d1020..330542eb9 100644
--- a/src/core/FilePath.cpp
+++ b/src/core/FilePath.cpp
@@ -1,4 +1,5 @@
/*
+ * Copyright (C) 2017 KeePassXC Team <team@keepassxc.org>
* Copyright (C) 2011 Felix Geyer <debfx@fobos.de>
*
* This program is free software: you can redistribute it and/or modify
@@ -23,6 +24,7 @@
#include "config-keepassx.h"
#include "core/Global.h"
+#include "core/Config.h"
FilePath* FilePath::m_instance(nullptr);
@@ -89,15 +91,23 @@ QString FilePath::pluginPath(const QString& name)
return QString();
}
+QString FilePath::wordlistPath(const QString& name)
+{
+ return dataPath("wordlists/" + name);
+}
+
QIcon FilePath::applicationIcon()
{
+ bool darkIcon = useDarkIcon();
+
#ifdef KEEPASSXC_DIST_SNAP
- return icon("apps", "keepassxc", false);
+ return (darkIcon) ? icon("apps", "keepassxc-dark", false) : icon("apps", "keepassxc", false);
#else
- return icon("apps", "keepassxc");
+ return (darkIcon) ? icon("apps", "keepassxc-dark") : icon("apps", "keepassxc");
#endif
}
+
QIcon FilePath::trayIconLocked()
{
#ifdef KEEPASSXC_DIST_SNAP
@@ -109,10 +119,12 @@ QIcon FilePath::trayIconLocked()
QIcon FilePath::trayIconUnlocked()
{
+ bool darkIcon = useDarkIcon();
+
#ifdef KEEPASSXC_DIST_SNAP
- return icon("apps", "keepassxc-unlocked", false);
+ return darkIcon ? icon("apps", "keepassxc-dark", false) : icon("apps", "keepassxc-unlocked", false);
#else
- return icon("apps", "keepassxc-unlocked");
+ return darkIcon ? icon("apps", "keepassxc-dark") : icon("apps", "keepassxc-unlocked");
#endif
}
@@ -246,6 +258,11 @@ bool FilePath::testSetDir(const QString& dir)
}
}
+bool FilePath::useDarkIcon()
+{
+ return config()->get("GUI/DarkTrayIcon").toBool();
+}
+
FilePath* FilePath::instance()
{
if (!m_instance) {