|
37 | 37 | #include <QFileInfo> |
38 | 38 | #include <QRegularExpression> |
39 | 39 | #include <QDebug> |
| 40 | +#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) |
| 41 | +#include <QStringConverter> |
| 42 | +#endif |
40 | 43 |
|
41 | 44 | #define SA(x) QString::fromLatin1(x) |
42 | 45 |
|
@@ -1165,3 +1168,46 @@ void Expert::refresh() |
1165 | 1168 | m_treeWidget->setCurrentItem(m_treeWidget->invisibleRootItem()->child(0)); |
1166 | 1169 | } |
1167 | 1170 |
|
| 1171 | +bool compareFunction (QString a, QString b) {return a<b;} |
| 1172 | + |
| 1173 | +void Expert::dump() |
| 1174 | +{ |
| 1175 | + QFile fileOut(SA("dump_%1.txt").arg(DoxygenWizard::langCode)); |
| 1176 | + if (fileOut.open(QFile::WriteOnly|QFile::Text)) |
| 1177 | + { |
| 1178 | + QTextStream out(&fileOut); |
| 1179 | +#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) |
| 1180 | + out.setCodec(QTextCodec::codecForName("UTF-8")); |
| 1181 | +#else |
| 1182 | + out.setEncoding(QStringConverter::Utf8); |
| 1183 | +#endif |
| 1184 | + QHashIterator<QString, Input*> i(m_options); |
| 1185 | + std::vector<QString> v; |
| 1186 | + while (i.hasNext()) |
| 1187 | + { |
| 1188 | + i.next(); |
| 1189 | + if (!i.value()) |
| 1190 | + { |
| 1191 | + // no value present, like for not compiled in settings (CLANG_...) |
| 1192 | + } |
| 1193 | + else if (i.value()->docs().isEmpty()) |
| 1194 | + { |
| 1195 | + // no documentation present, like for Obsolete items |
| 1196 | + } |
| 1197 | + else |
| 1198 | + { |
| 1199 | + v.push_back(i.key()); |
| 1200 | + } |
| 1201 | + } |
| 1202 | + std::sort(v.begin(),v.end(),compareFunction); |
| 1203 | + for (const auto & n : v) |
| 1204 | + { |
| 1205 | + out << n << ": " << m_options[n]->docs() << "\n"; |
| 1206 | + out << SA("=================================\n"); |
| 1207 | + } |
| 1208 | + |
| 1209 | + fileOut.flush(); |
| 1210 | + fileOut.close(); |
| 1211 | + } |
| 1212 | +} |
| 1213 | + |
0 commit comments