* @brief Resolves the path to the password store directory. * @details Initializes the environment, checks for the * PASSWORD_STORE_DIR variable, and falls back to a platform-specific default * location under the user's home directory. * @return QString - Normalized path to the password store folder. */
| 75 | * @return QString - Normalized path to the password store folder. |
| 76 | */ |
| 77 | auto Util::findPasswordStore() -> QString { |
| 78 | QString path; |
| 79 | initialiseEnvironment(); |
| 80 | if (_env.contains("PASSWORD_STORE_DIR")) { |
| 81 | path = _env.value("PASSWORD_STORE_DIR"); |
| 82 | } else { |
| 83 | #ifdef Q_OS_WIN |
| 84 | path = QDir::homePath() + QDir::separator() + "password-store" + |
| 85 | QDir::separator(); |
| 86 | #else |
| 87 | path = QDir::homePath() + QDir::separator() + ".password-store" + |
| 88 | QDir::separator(); |
| 89 | #endif |
| 90 | } |
| 91 | return Util::normalizeFolderPath(path); |
| 92 | } |
| 93 | |
| 94 | auto Util::normalizeFolderPath(const QString &path) -> QString { |
| 95 | QString normalizedPath = path; |
nothing calls this directly
no outgoing calls
no test coverage detected