blob: 3eb697f0fe31f54ce44c13336bafa3064d3fb164 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
|
#ifndef UTILS_H
#define UTILS_H
#include <QObject>
#include <QDebug>
#include <QFileInfo>
#include <QStandardPaths>
#include <QDir>
#include <QTextDocument>
#include <QUuid>
#include <QApplication>
#include <QDateTime>
#include <QDesktopServices>
#include <QMessageBox>
#include <QProcessEnvironment>
#include <QRandomGenerator>
#include <QRegularExpression>
#include <QProcess>
class utils : public QObject
{
Q_OBJECT
public:
utils(QObject* parent=0);
virtual ~utils();
public slots:
static QString refreshCacheSize(const QString cache_dir);
static bool delete_cache(const QString cache_dir);
static QString toCamelCase(const QString &s);
static QString generateRandomId(int length);
static QString genRand(int length);
static QString convertSectoDay(qint64 secs);
static QString returnPath(QString pathname, QString standardLocation);
static QString EncodeXML ( const QString& encodeMe );
static QString DecodeXML ( const QString& decodeMe );
static QString htmlToPlainText(QString str);
static QString GetEnvironmentVar(const QString &variable_name);
static float RoundToOneDecimal(float number);
void DisplayExceptionErrorDialog(const QString &error_info);
static QString appDebugInfo();
static void desktopOpenUrl(const QString str);
private slots:
//use refreshCacheSize
static quint64 dir_size(const QString &directory);
};
#endif // UTILS_H
|