MCPcopy Create free account
hub / github.com/IENT/YUView / readFromFile

Method readFromFile

YUViewLib/src/handler/UpdateHandlerFile.cpp:62–88  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

60}
61
62void 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
90void updateFileHandler::readRemoteFromData(QByteArray &arr)
91{

Callers 1

updateFileHandlerMethod · 0.95

Calls 3

parseOneLineMethod · 0.95
readLineMethod · 0.80
atEndMethod · 0.45

Tested by

no test coverage detected