src/sources/writer.cpp
// Create unique name for the temporary file
// @output:
// - QString - string with the absolute path to the temporary file that is not
// exist yet. If function failed to create unique path, it will return empty
// string.
Create unique name for the temporary file
Create unique name for the temporary file
QString WriterPrivate::getTempFileName()
{
    QString nameTemplate = QDir::tempPath() + "/qtcsv_" +
                QString::number(QCoreApplication::applicationPid()) + "_%1.csv";
    for (int counter = 0; counter < std::numeric_limits<int>::max(); ++counter)
    {
        QString name = nameTemplate.arg(QString::number(qrand()));
        if ( false == QFile::exists(name) )
        {
            return name;
        }
    }
    return QString();
}
QString WriterPrivate :: getTempFileName ( ) { QString nameTemplate = QDir :: tempPath ( ) + " " + QString :: number ( QCoreApplication :: applicationPid ( ) ) + " " ; for ( int counter = 0 ; counter < std :: numeric_limits < int > :: max ( ) ; ++ counter ) { QString name = nameTemplate . arg ( QString :: number ( qrand ( ) ) ) ; if ( false == QFile :: exists ( name ) ) { return name ; } } return QString ( ) ; }
Create unique name for the temporary file
Create unique name for the temporary file