|
QtPass 1.6.0
Multi-platform GUI for pass, the standard unix password manager.
|
Static utility functions implementation. More...
#include <util.h>
Static Public Member Functions | |
| static auto | findBinaryInPath (QString binary) -> QString |
| Locate an executable by searching the process PATH and (on Windows) falling back to WSL. | |
| static auto | findPasswordStore () -> QString |
| Locate the password store directory. | |
| static auto | normalizeFolderPath (const QString &path) -> QString |
| Ensure a folder path always ends with the native directory separator. | |
| static auto | configIsValid () -> bool |
| Verify that the required configuration is complete. | |
| static auto | getDir (const QModelIndex &index, bool forPass, const QFileSystemModel &model, const StoreModel &storeModel) -> QString |
| Get the selected folder path, either relative to the configured pass store or absolute. | |
| static auto | endsWithGpg () -> const QRegularExpression & |
| Returns a regex to match .gpg file extensions. | |
| static auto | protocolRegex () -> const QRegularExpression & |
| Returns a regex to match URL protocols. | |
| static auto | newLinesRegex () -> const QRegularExpression & |
| Returns a regex to match newline characters. | |
| static auto | isValidKeyId (const QString &keyId) -> bool |
| Check if a string looks like a valid GPG key ID. Validates a GPG key ID after normalization: | |
Static utility functions implementation.
Some static utilities to be used elsewhere.
Implementation of utility functions for path handling, binary discovery, and configuration validation.
|
static |
Verify that the required configuration is complete.
Definition at line 188 of file util.cpp.
|
static |
Returns a regex to match .gpg file extensions.
Definition at line 249 of file util.cpp.
|
static |
Locate an executable by searching the process PATH and (on Windows) falling back to WSL.
| binary | Executable name or relative path to locate (e.g., "gpg" or "pass"). |
Definition at line 120 of file util.cpp.
|
static |
Locate the password store directory.
Resolves the path to the password store directory.
Initializes the environment, checks for the variable, and falls back to a platform-specific default location under the user's home directory.
PASSWORD_STORE_DIR
Definition at line 77 of file util.cpp.
|
static |
Get the selected folder path, either relative to the configured pass store or absolute.
| index | Model index selecting the file or folder. |
| forPass | If true, return the path relative to the pass store; otherwise return an absolute path. |
| model | Filesystem model used to resolve the index. |
| storeModel | StoreModel used to map view indexes to the filesystem model. |
Definition at line 231 of file util.cpp.
|
static |
Check if a string looks like a valid GPG key ID. Validates a GPG key ID after normalization:
| keyId | The string to validate. |
Definition at line 277 of file util.cpp.
|
static |
Returns a regex to match newline characters.
Definition at line 272 of file util.cpp.
|
static |
Ensure a folder path always ends with the native directory separator.
| path | The folder path to normalize. |
Definition at line 94 of file util.cpp.
|
static |
Returns a regex to match URL protocols.
Returns a regex matching common remote/network protocol schemes.
Matches http://, https://, ftp://, ftps://, ssh://, sftp://, webdav://, webdavs://
Note: Local file URLs (file:///) are intentionally excluded by design, as they represent local paths rather than network protocols. If this behavior needs to change, update both this function and the corresponding test.