* @brief Initializes the pass wrapper environment. */
| 113 | * @brief Initializes the pass wrapper environment. |
| 114 | */ |
| 115 | void Pass::init() { |
| 116 | #ifdef __APPLE__ |
| 117 | // If it exists, add the gpgtools to PATH |
| 118 | if (QFile("/usr/local/MacGPG2/bin").exists()) |
| 119 | env.replaceInStrings("PATH=", "PATH=/usr/local/MacGPG2/bin:"); |
| 120 | // Add missing /usr/local/bin |
| 121 | if (env.filter("/usr/local/bin").isEmpty()) |
| 122 | env.replaceInStrings("PATH=", "PATH=/usr/local/bin:"); |
| 123 | #endif |
| 124 | |
| 125 | if (!QtPassSettings::getGpgHome().isEmpty()) { |
| 126 | QDir absHome(QtPassSettings::getGpgHome()); |
| 127 | absHome.makeAbsolute(); |
| 128 | env << "GNUPGHOME=" + absHome.path(); |
| 129 | } |
| 130 | } |
| 131 | |
| 132 | /** |
| 133 | * @brief Pass::Generate use either pwgen or internal password |
no outgoing calls
no test coverage detected