QtPass 1.4.0
Multi-platform GUI for pass, the standard unix password manager.
Loading...
Searching...
No Matches
util.h
Go to the documentation of this file.
1#ifndef UTIL_H_
2#define UTIL_H_
3
4#include "storemodel.h"
5#include <QFileSystemModel>
6#include <QProcessEnvironment>
7#include <QRegularExpression>
8#include <QString>
9
10class StoreModel;
11
16class Util {
17public:
18 static QString findBinaryInPath(QString binary);
19 static QString findPasswordStore();
20 static QString normalizeFolderPath(QString path);
21 static bool checkConfig();
22 static QString getDir(const QModelIndex &index, bool forPass,
23 const QFileSystemModel &model,
24 const StoreModel &storeModel);
25 static void copyDir(const QString &src, const QString &dest);
26 static const QRegularExpression &endsWithGpg();
27 static const QRegularExpression &protocolRegex();
28
29private:
30 static void initialiseEnvironment();
31 static QProcessEnvironment _env;
32 static bool _envInitialised;
33};
34
35#endif // UTIL_H_
The QSortFilterProxyModel for handling filesystem searches.
Definition: storemodel.h:11
Some static utilities to be used elsewhere.
Definition: util.h:16
static bool checkConfig()
Util::checkConfig do we have prequisite settings?
Definition: util.cpp:142
static QString findPasswordStore()
Util::findPasswordStore look for common .password-store folder location.
Definition: util.cpp:56
static QString getDir(const QModelIndex &index, bool forPass, const QFileSystemModel &model, const StoreModel &storeModel)
Util::getDir get selectd folder path.
Definition: util.cpp:160
static const QRegularExpression & protocolRegex()
Definition: util.cpp:203
static const QRegularExpression & endsWithGpg()
Definition: util.cpp:198
static QString normalizeFolderPath(QString path)
Util::normalizeFolderPath let's always end folders with a QDir::separator()
Definition: util.cpp:79
static QString findBinaryInPath(QString binary)
Util::findBinaryInPath search for executables.
Definition: util.cpp:90
static void copyDir(const QString &src, const QString &dest)
Util::copyDir.
Definition: util.cpp:182