QTfrontend/ui/widget/feedbackdialog.cpp
changeset 9163 67334acaaac7
parent 9080 9b42757d7e71
child 9323 18b6faf4e408
equal deleted inserted replaced
9161:b2f02b083374 9163:67334acaaac7
    32 #include <QCheckBox>
    32 #include <QCheckBox>
    33 #include <QByteArray>
    33 #include <QByteArray>
    34 
    34 
    35 #include <string>
    35 #include <string>
    36 
    36 
    37 #ifdef Q_WS_WIN
    37 #ifdef Q_OS_WIN
    38 #define WINVER 0x0500
    38 #define WINVER 0x0500
    39 #include <windows.h>
    39 #include <windows.h>
    40 #else
    40 #else
    41 #include <unistd.h>
    41 #include <unistd.h>
    42 #include <sys/types.h>
    42 #include <sys/types.h>
    43 #endif
    43 #endif
    44 
    44 
    45 #ifdef Q_WS_MAC
    45 #ifdef Q_OS_MAC
    46 #include <sys/sysctl.h>
    46 #include <sys/sysctl.h>
    47 #ifndef _SC_NPROCESSORS_ONLN
    47 #ifndef _SC_NPROCESSORS_ONLN
    48 #define _SC_NPROCESSORS_ONLN 58
    48 #define _SC_NPROCESSORS_ONLN 58
    49 #endif
    49 #endif
    50 #endif
    50 #endif
   205         QString::number(screen->width()) + "x" + QString::number(screen->height()) + "\n";
   205         QString::number(screen->width()) + "x" + QString::number(screen->height()) + "\n";
   206     QString number_of_screens = "Number of screens: " + QString::number(screen->screenCount()) + "\n";
   206     QString number_of_screens = "Number of screens: " + QString::number(screen->screenCount()) + "\n";
   207     QString processor_name = "Processor: ";
   207     QString processor_name = "Processor: ";
   208 
   208 
   209     // platform specific code
   209     // platform specific code
   210 #ifdef Q_WS_MACX
   210 #ifdef Q_OS_MACX
   211     number_of_cores += QString::number(sysconf(_SC_NPROCESSORS_ONLN)) + "\n";
   211     number_of_cores += QString::number(sysconf(_SC_NPROCESSORS_ONLN)) + "\n";
   212 
   212 
   213     uint64_t memsize;
   213     uint64_t memsize;
   214     size_t len = sizeof(memsize);
   214     size_t len = sizeof(memsize);
   215     static int mib_s[2] = { CTL_HW, HW_MEMSIZE };
   215     static int mib_s[2] = { CTL_HW, HW_MEMSIZE };
   238         case 7:  os_version += "\"Lion\"\n"; break;
   238         case 7:  os_version += "\"Lion\"\n"; break;
   239         case 8:  os_version += "\"Mountain Lion\"\n"; break;
   239         case 8:  os_version += "\"Mountain Lion\"\n"; break;
   240         default: os_version += "\"Unknown version\"\n"; break;
   240         default: os_version += "\"Unknown version\"\n"; break;
   241     }
   241     }
   242 #endif
   242 #endif
   243 #ifdef Q_WS_WIN
   243 #ifdef Q_OS_WIN
   244     SYSTEM_INFO sysinfo;
   244     SYSTEM_INFO sysinfo;
   245     GetSystemInfo(&sysinfo);
   245     GetSystemInfo(&sysinfo);
   246     number_of_cores += QString::number(sysinfo.dwNumberOfProcessors) + "\n";
   246     number_of_cores += QString::number(sysinfo.dwNumberOfProcessors) + "\n";
   247     MEMORYSTATUSEX status;
   247     MEMORYSTATUSEX status;
   248     status.dwLength = sizeof(status);
   248     status.dwLength = sizeof(status);
   260         //case QSysInfo::WV_WINDOWS8: os_version += "Windows 8\n"; break; //QT 5+
   260         //case QSysInfo::WV_WINDOWS8: os_version += "Windows 8\n"; break; //QT 5+
   261         default: os_version += "Windows (Unknown version)\n"; break;
   261         default: os_version += "Windows (Unknown version)\n"; break;
   262     }
   262     }
   263     kernel_line += "Windows kernel\n";
   263     kernel_line += "Windows kernel\n";
   264 #endif
   264 #endif
   265 #ifdef Q_WS_X11
   265 #ifdef Q_OS_X11
   266     number_of_cores += QString::number(sysconf(_SC_NPROCESSORS_ONLN)) + "\n";
   266     number_of_cores += QString::number(sysconf(_SC_NPROCESSORS_ONLN)) + "\n";
   267     long pages = sysconf(_SC_PHYS_PAGES),
   267     long pages = sysconf(_SC_PHYS_PAGES),
   268 /*
   268 /*
   269 #ifndef Q_OS_FREEBSD
   269 #ifndef Q_OS_FREEBSD
   270          available_pages = sysconf(_SC_AVPHYS_PAGES),
   270          available_pages = sysconf(_SC_AVPHYS_PAGES),
   275     total_ram += QString::number(pages*page_size/1024/1024) + " MB\n";
   275     total_ram += QString::number(pages*page_size/1024/1024) + " MB\n";
   276     os_version += "GNU/Linux or BSD\n";
   276     os_version += "GNU/Linux or BSD\n";
   277 #endif
   277 #endif
   278 
   278 
   279     // uname -a
   279     // uname -a
   280 #if defined(Q_WS_X11) || defined(Q_WS_MACX)
   280 #if defined(Q_OS_X11) || defined(Q_OS_MAC)
   281     QProcess *process = new QProcess();
   281     QProcess *process = new QProcess();
   282     QStringList arguments = QStringList("-a");
   282     QStringList arguments = QStringList("-a");
   283     process->start("uname", arguments);
   283     process->start("uname", arguments);
   284     if (process->waitForFinished())
   284     if (process->waitForFinished())
   285         kernel_line += QString(process->readAll());
   285         kernel_line += QString(process->readAll());
   286     delete process;
   286     delete process;
   287 #endif
   287 #endif
   288 
   288 
   289 #if (!defined(Q_WS_MACX) && defined(__i386__)) || defined(__x86_64__)
   289 #if (!defined(Q_OS_MAC) && defined(__i386__)) || defined(__x86_64__)
   290     // cpu info
   290     // cpu info
   291     quint32 registers[4];
   291     quint32 registers[4];
   292     quint32 i;
   292     quint32 i;
   293 
   293 
   294     i = 0x80000002;
   294     i = 0x80000002;