MCPcopy Create free account
hub / github.com/IJHack/QtPass / findPasswordStore

Method findPasswordStore

src/util.cpp:77–92  ·  view source on GitHub ↗

* @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. */

Source from the content-addressed store, hash-verified

75 * @return QString - Normalized path to the password store folder.
76 */
77auto 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
94auto Util::normalizeFolderPath(const QString &path) -> QString {
95 QString normalizedPath = path;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected