| 74 | } |
| 75 | |
| 76 | void runPciconf(QStringList& log) |
| 77 | { |
| 78 | char buff[512]; |
| 79 | std::string strcard; |
| 80 | FILE* pciconf = popen("pciconf -lv -a vgapci0", "r"); |
| 81 | while (fgets(buff, 512, pciconf) != NULL) { |
| 82 | if (strncmp(buff, " vendor", 10) == 0) { |
| 83 | std::string str(buff); |
| 84 | strcard.append(str.substr(str.find_first_of("'") + 1, str.find_last_not_of("'") - (str.find_first_of("'") + 2))); |
| 85 | strcard.append(" "); |
| 86 | } else if (strncmp(buff, " device", 10) == 0) { |
| 87 | std::string str2(buff); |
| 88 | strcard.append(str2.substr(str2.find_first_of("'") + 1, str2.find_last_not_of("'") - (str2.find_first_of("'") + 2))); |
| 89 | } |
| 90 | log << QString::fromStdString(strcard); |
| 91 | break; |
| 92 | } |
| 93 | pclose(pciconf); |
| 94 | } |
| 95 | #endif |
| 96 | void runGlxinfo(QStringList& log) |
| 97 | { |
no test coverage detected