| 34 | } |
| 35 | |
| 36 | void runLspci(QStringList& log) |
| 37 | { |
| 38 | // FIXME: fixed size buffers... |
| 39 | char buff[512]; |
| 40 | int gpuline = -1; |
| 41 | int cline = 0; |
| 42 | FILE* lspci = popen("lspci -k", "r"); |
| 43 | |
| 44 | if (!lspci) |
| 45 | return; |
| 46 | |
| 47 | while (fgets(buff, 512, lspci) != NULL) { |
| 48 | std::string str(buff); |
| 49 | if (str.length() < 9) |
| 50 | continue; |
| 51 | if (str.substr(8, 3) == "VGA") { |
| 52 | gpuline = cline; |
| 53 | log << QString::fromStdString(str.substr(35, std::string::npos)); |
| 54 | } |
| 55 | if (gpuline > -1 && gpuline != cline) { |
| 56 | if (cline - gpuline < 3) { |
| 57 | log << QString::fromStdString(str.substr(1, std::string::npos)); |
| 58 | } |
| 59 | } |
| 60 | cline++; |
| 61 | } |
| 62 | pclose(lspci); |
| 63 | } |
| 64 | #elif defined(Q_OS_FREEBSD) |
| 65 | void runSysctlHwModel(QStringList& log) |
| 66 | { |
no test coverage detected