diff options
author | 2021-04-07 21:48:40 +0530 | |
---|---|---|
committer | 2021-04-07 21:48:40 +0530 | |
commit | b2bfcedca995d130ba670f20e8a2cb88e96ce750 (patch) | |
tree | c5e907e4c4ac9cf0c4079e1665925cae6570ef4b /src/utils.h | |
parent | 975ab60d42d135337d5fee230a38965adbd6b234 (diff) | |
download | whatsie-b2bfcedca995d130ba670f20e8a2cb88e96ce750.tar.gz whatsie-b2bfcedca995d130ba670f20e8a2cb88e96ce750.zip |
utils class update
Diffstat (limited to 'src/utils.h')
-rw-r--r-- | src/utils.h | 55 |
1 files changed, 6 insertions, 49 deletions
diff --git a/src/utils.h b/src/utils.h index 9d2520f..fecaab7 100644 --- a/src/utils.h +++ b/src/utils.h @@ -24,56 +24,13 @@ public slots: static QString genRand(int length); static QString convertSectoDay(qint64 secs); static QString returnPath(QString pathname); - - static QString EncodeXML ( const QString& encodeMe ){ - - QString temp; - int length = encodeMe.size(); - for (int index = 0; index < length; index++) - { - QChar character(encodeMe.at(index)); - - switch (character.unicode()) - { - case '&': - temp += "&"; break; - - case '\'': - temp += "'"; break; - - case '"': - temp += """; break; - - case '<': - temp += "<"; break; - - case '>': - temp += ">"; break; - - default: - temp += character; - break; - } - } - - return temp; - } - - static QString DecodeXML ( const QString& decodeMe ) { - - QString temp(decodeMe); - - temp.replace("&", "&"); - temp.replace("'", "'"); - temp.replace(""", "\""); - temp.replace("<", "<"); - temp.replace(">", ">"); - - return temp; - } - + 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(); private slots: //use refreshCacheSize static quint64 dir_size(const QString &directory); |