| 61 | namespace |
| 62 | { |
| 63 | void FormatMapSize(uint64_t sizeInBytes, std::string & units, size_t & sizeToDownload) |
| 64 | { |
| 65 | int const mbInBytes = 1024 * 1024; |
| 66 | int const kbInBytes = 1024; |
| 67 | if (sizeInBytes > mbInBytes) |
| 68 | { |
| 69 | sizeToDownload = (sizeInBytes + mbInBytes - 1) / mbInBytes; |
| 70 | units = "MB"; |
| 71 | } |
| 72 | else if (sizeInBytes > kbInBytes) |
| 73 | { |
| 74 | sizeToDownload = (sizeInBytes + kbInBytes - 1) / kbInBytes; |
| 75 | units = "KB"; |
| 76 | } |
| 77 | else |
| 78 | { |
| 79 | sizeToDownload = sizeInBytes; |
| 80 | units = "B"; |
| 81 | } |
| 82 | } |
| 83 | |
| 84 | template <class T> |
| 85 | T * CreateBlackControl(QString const & name) |
no outgoing calls
no test coverage detected