36 #include "Utils/Macros.h" 39 #define scast(x, y) static_cast<x>(y) 40 #define dcast(x, y) dynamic_cast<x>(y) 41 #define rcast(x, y) reinterpret_cast<x>(y) 51 uint64_t currentDateToInt();
52 uint64_t dateToInt(
const QDateTime& date);
53 QDateTime intToDate(uint64_t date);
77 QString
msToString(MilliSeconds msec,
const QString& format);
79 QString convertNotNull(
const QString& str);
95 QString
sharePath(
const QString& append_path);
102 QString
tempPath(
const QString& append_path);
113 bool underline=
true);
118 const QString& target);
145 QStringList imageExtensions(
bool with_asterisk=
true);
156 using Extensions=uint16_t;
164 QString
getFileFilter(Extensions extensions,
const QString& name);
175 QString randomString(
int max_chars);
184 QString
easyTagFinder(
const QString& tag,
const QString& xml_doc);
191 QByteArray
calcHash(
const QByteArray& data);
208 QByteArray convertPixmapToByteArray(
const QPixmap& pm);
209 QByteArray convertPixmapToByteArray(
const QPixmap& pm,
const char* format);
210 QPixmap convertByteArrayToPixmap(
const QByteArray& arr);
218 void unsetEnvironment(
const QString& key);
219 QString getEnvironment(
const char* key);
QString soundfileFilter()
get filter for file reader or file chooser
QString sayonaraPath()
get sayonara path in home directory
QString getFileFilter(Extensions extensions, const QString &name)
get filter for file chooser dialog based on extensions
QStringList ipAddresses()
get all ip addresses of the host
QString msToString(MilliSeconds msec, const QString &format)
Convert milliseconds to string.
QString tempPath()
get a temporary directory. usually /tmp/sayonara
QString easyTagFinder(const QString &tag, const QString &xml_doc)
gets value out of tag
QString stringToFirstUpper(const QString &str)
Transform all letters after a space to upper case.
void sleepMs(uint64_t ms)
sleep
QStringList playlistExtensions(bool with_asterisk=true)
get all supported playlist file extensions
int randomNumber(int min, int max)
get a random val between min max
QString stringToVeryFirstUpper(const QString &str)
Transform only first letter to upper case.
Helper functions.
Definition: GenreView.h:35
QString createLink(const QString &name, bool dark=true, bool underline=true)
create a link string
QStringList soundfileExtensions(bool with_asterisk=true)
get all supported sound file extensions
QString sharePath()
get share path of sayonara
QStringList podcastExtensions(bool with_asterisk=true)
get all supported podcast file extensions
void setEnvironment(const QString &key, const QString &value)
set an environment variable. This function is platform independent
QByteArray calcHash(const QByteArray &data)
calculate a md5 hashsum