| 103 | } |
| 104 | |
| 105 | QString CodeLensTree::readFileLine(const QString &filePath, int line) |
| 106 | { |
| 107 | QFile file(filePath); |
| 108 | if (!file.open(QFile::ReadOnly | QFile::Text)) |
| 109 | return {}; |
| 110 | |
| 111 | QTextStream in(&file); |
| 112 | int lineCount = 0; |
| 113 | while (!in.atEnd()) { |
| 114 | QString text = in.readLine(); |
| 115 | if (line == lineCount) |
| 116 | return text; |
| 117 | lineCount++; |
| 118 | } |
| 119 | |
| 120 | file.close(); |
| 121 | return {}; |
| 122 | } |