예제 #1
0
void HttpDownload::prepareDownload()
{
    // Open file and read it
    QFile file(installationPath + "launcher/downloads/files_game.txt");

    if (file.open(QIODevice::ReadOnly))
    {
        QTextStream in(&file);

        while ( !in.atEnd() )
        {
            QStringList tmp = QString(in.readLine()).split(";");

            // Check if we got valid input
            if(tmp.size() == 3)
            {
                // Save values
                fileList.append(tmp.at(0));
                fileListMD5.append(tmp.at(1));
                fileListSize.append(tmp.at(2));
                //totalSizeDownload += tmp.at(2).toInt();
            }
        }
    }

    checkFilesWithHash();

    // Close file
    file.close();
}
예제 #2
0
void HttpDownload::prepareDownload()
{
    Logging::addEntry(LOG_LEVEL_INF, "Preparing files to download", FUNCTION_NAME);

    // Open file and read it
#ifdef BUILD_CUSTOM
    QFile file(installationPath + "launcher/downloads/files_game_custom.txt");
#else
    QFile file(installationPath + "launcher/downloads/files_game.txt");
#endif
    if (file.open(QIODevice::ReadOnly))
    {
        QTextStream in(&file);

        while ( !in.atEnd() )
        {
            QStringList tmp = QString(in.readLine()).split(";");

            // Check if we got valid input
            if(tmp.size() == 3)
            {
                // Save values
                fileList.append(tmp.at(0));
                fileListMD5.append(tmp.at(1));
                fileListSize.append(tmp.at(2));
                //totalSizeDownload += tmp.at(2).toInt();
            }
        }
    }

    checkFilesWithHash();

    // Close file
    file.close();
}