Ticket #8634: clean_md5_output.patch

File clean_md5_output.patch, 1.2 KB (added by jvprat, 17 years ago)

Clean the MD5 output

  • common/advancedDetector.cpp

     
    254254        IntMap filesSize;
    255255        IntMap allFiles;
    256256
     257        List<String> sortedFiles;
     258
    257259        String tstr, tstr2;
    258260       
    259261        uint i;
     
    274276                        tstr = String(fileDesc->fileName);
    275277                        tstr.toLowercase();
    276278                        tstr2 = tstr + ".";
     279                        if (!filesList.contains(tstr)) {
     280                                sortedFiles.push_back(tstr);
     281                        }
    277282                        filesList[tstr] = true;
    278283                        filesList[tstr2] = true;
    279284                }
     
    410415                printf("data to the ScummVM team along with name of the game you tried to add\n");
    411416                printf("and its version/language/etc.:\n");
    412417
    413                 for (StringMap::const_iterator file = filesMD5.begin(); file != filesMD5.end(); ++file)
    414                         printf("  \"%s\", \"%s\", %d\n", file->_key.c_str(), file->_value.c_str(), filesSize[file->_key]);
     418                sort(sortedFiles.begin(), sortedFiles.end());
     419                for (List<String>::iterator file = sortedFiles.begin(); file != sortedFiles.end(); ++file) {
     420                        if (filesMD5.contains(*file))
     421                        printf("  \"%s\", \"%s\", %d\n", file->c_str(), filesMD5[*file].c_str(), filesSize[*file]);
     422                }
    415423
    416424                printf("\n");
    417425        }