utils.cpp 507 Bytes
Newer Older
Thiago C. Santini's avatar
Thiago C. Santini committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
#include "utils.h"

QString getTimestampStr()
{
    QTimeZone tz(settings.value("outputTimestamp/tz").toByteArray());
    QString format(settings.value("outputTimestamp/format").toString());
    return QDateTime::currentDateTimeUtc().toTimeZone(tz).toString(format);
}

QString getNamePrefix()
{
    QString base(gCurrentSubjectName);

    if (! gCurrentSubjectName.isEmpty())
        base.append("_");

    base.append(getTimestampStr());

    return base.append("_");
}

QString gCurrentSubjectName = "";