diff options
| author | 2023-03-07 21:11:06 +0600 | |
|---|---|---|
| committer | 2023-03-07 21:11:06 +0600 | |
| commit | d830bfc8ce7c6763d074beafdde7cab1835d31f9 (patch) | |
| tree | 179f81f3b42779b1f6fb69deed6b69dab39f4f89 /src/utils.h | |
| download | whatsie-d830bfc8ce7c6763d074beafdde7cab1835d31f9.tar.gz whatsie-d830bfc8ce7c6763d074beafdde7cab1835d31f9.zip | |
Import Upstream version 4.12.0upstream/4.12.0
Diffstat (limited to 'src/utils.h')
| -rw-r--r-- | src/utils.h | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/src/utils.h b/src/utils.h new file mode 100644 index 0000000..d5b9765 --- /dev/null +++ b/src/utils.h @@ -0,0 +1,48 @@ +#ifndef UTILS_H +#define UTILS_H + +#include <QApplication> +#include <QDateTime> +#include <QDebug> +#include <QDesktopServices> +#include <QDir> +#include <QFileInfo> +#include <QMessageBox> +#include <QObject> +#include <QProcess> +#include <QProcessEnvironment> +#include <QRandomGenerator> +#include <QRegularExpression> +#include <QStandardPaths> +#include <QTextDocument> +#include <QUuid> + +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(const QString &str); + static QString GetEnvironmentVar(const QString &variable_name); + static float RoundToOneDecimal(float number); + static void DisplayExceptionErrorDialog(const QString &error_info); + static QString appDebugInfo(); + static void desktopOpenUrl(const QString &str); + static bool isPhoneNumber(const QString &phoneNumber); +private slots: + // use refreshCacheSize + static quint64 dir_size(const QString &directory); +}; + +#endif // UTILS_H |
