QtPass  1.2.0-pre
Multi-platform GUI for pass, the standard unix password manager.
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 <QString>
8 
9 class StoreModel;
14 class Util {
15 public:
16  static QString findBinaryInPath(QString binary);
17  static QString findPasswordStore();
18  static QString normalizeFolderPath(QString path);
19  static bool checkConfig();
20  static void qSleep(int ms);
21  static QString getDir(const QModelIndex &index, bool forPass,
22  const QFileSystemModel &model,
23  const StoreModel &storeModel);
24  static void copyDir(const QString src, const QString dest);
25  static int rand();
26 
27 private:
28  static void initialiseEnvironment();
29  static QProcessEnvironment _env;
30  static bool _envInitialised;
31 };
32 
33 #endif // UTIL_H_
static QString findBinaryInPath(QString binary)
Util::findBinaryInPath search for executables.
Definition: util.cpp:78
static int rand()
Definition: util.cpp:181
The QSortFilterProxyModel for handling filesystem searches.
Definition: storemodel.h:16
static void copyDir(const QString src, const QString dest)
Definition: util.cpp:165
static QString getDir(const QModelIndex &index, bool forPass, const QFileSystemModel &model, const StoreModel &storeModel)
Util::getDir get selectd folder path.
Definition: util.cpp:149
static void qSleep(int ms)
Util::qSleep because . . windows sleep.
Definition: util.cpp:132
Some static utilities to be used elsewhere.
Definition: util.h:14
static QString findPasswordStore()
Util::findPasswordStore look for common .password-store folder location.
Definition: util.cpp:44
static bool checkConfig()
Util::checkConfig do we have prequisite settings?
Definition: util.cpp:121
static QString normalizeFolderPath(QString path)
Util::normalizeFolderPath let&#39;s always end folders with a QDir::separator()
Definition: util.cpp:67