| 111 | } |
| 112 | |
| 113 | void check(const QString &fileName) |
| 114 | { |
| 115 | QFile file(fileName); |
| 116 | if (!file.open(QIODevice::ReadOnly)) { |
| 117 | qDebug("unable to open file: '%s' (%s)", fileName.toLocal8Bit().constData(), file.errorString().toLocal8Bit().constData()); |
| 118 | return; |
| 119 | } |
| 120 | QStringList lines; |
| 121 | bool found = false; |
| 122 | while (true) { |
| 123 | QByteArray bline = file.readLine(16384); |
| 124 | if (bline.isEmpty()) |
| 125 | break; |
| 126 | QString line = QString::fromLocal8Bit(bline); |
| 127 | Q_ASSERT_X(line.endsWith("\n"), "check()", fileName.toLocal8Bit().constData()); |
| 128 | found |= checkSignature(fileName, line, "SLOT"); |
| 129 | found |= checkSignature(fileName, line, "SIGNAL"); |
| 130 | if (modify) |
| 131 | lines << line; |
| 132 | } |
| 133 | file.close(); |
| 134 | |
| 135 | if (found && modify) { |
| 136 | printf("Modifying file: '%s'\n", fileName.toLocal8Bit().constData()); |
| 137 | writeChanges(fileName, lines); |
| 138 | } |
| 139 | } |
| 140 | |
| 141 | void traverse(const QString &path) |
| 142 | { |
no test coverage detected