Пример #1
0
QString clientHandler::getTmpRandomFileName()
{
    //get new primary is pseudo generate algo for creating DB primary
    //key based DDMMYYHHMMSS. This is to replace DB default auto increment
    //that will lead inconsistantcy during data update, append, migration
    //and rollback
    QDateTime now;
    QString utc;
    quint64 primaryKey = 0;

    utc = now.currentDateTimeUtc().toString();
    utc.remove(QRegExp("[^0-9]"));
    primaryKey = utc.toLongLong() + now.currentMSecsSinceEpoch();

    return QString::number(primaryKey);
}