| 60 | } |
| 61 | |
| 62 | void updateFileHandler::readFromFile(QString fileName) |
| 63 | { |
| 64 | DEBUG_UPDATE_FILE("updateFileHandler::readFromFile Current working dir " << this->updatePath); |
| 65 | |
| 66 | // Open the file and get all files and their current version (int) from the file. |
| 67 | QFileInfo updateFileInfo(fileName); |
| 68 | if (!updateFileInfo.exists() || !updateFileInfo.isFile()) |
| 69 | { |
| 70 | DEBUG_UPDATE_FILE("updateFileHandler::readFromFile local update file " << fileName << " not found"); |
| 71 | return; |
| 72 | } |
| 73 | |
| 74 | // Read all lines from the file |
| 75 | QFile updateFile(fileName); |
| 76 | if (updateFile.open(QIODevice::ReadOnly)) |
| 77 | { |
| 78 | QTextStream in(&updateFile); |
| 79 | while (!in.atEnd()) |
| 80 | { |
| 81 | // Convert the line into a file/version pair (they should be separated by a space) |
| 82 | QString line = in.readLine(); |
| 83 | this->parseOneLine(line, true); |
| 84 | } |
| 85 | updateFile.close(); |
| 86 | } |
| 87 | this->loaded = true; |
| 88 | } |
| 89 | |
| 90 | void updateFileHandler::readRemoteFromData(QByteArray &arr) |
| 91 | { |
no test coverage detected