StelLogger.cpp   StelLogger.cpp 
skipping to change at line 126 skipping to change at line 126
if(!procVersion.open(QIODevice::ReadOnly | QIODevice::Text)) if(!procVersion.open(QIODevice::ReadOnly | QIODevice::Text))
writeLog("Unknown Linux version"); writeLog("Unknown Linux version");
else else
{ {
QString version = procVersion.readAll(); QString version = procVersion.readAll();
if(version.right(1) == "\n") if(version.right(1) == "\n")
version.chop(1); version.chop(1);
writeLog(version); writeLog(version);
procVersion.close(); procVersion.close();
} }
#elif defined Q_OS_BSD4
// Check FreeBSD, NetBSD, OpenBSD and DragonFly BSD
QProcess uname;
uname.start("/usr/bin/uname -srm");
uname.waitForStarted();
uname.waitForFinished();
const QString BSDsystem = uname.readAllStandardOutput();
writeLog(BSDsystem.trimmed());
#else #else
writeLog("Unknown operating system"); writeLog("Unknown operating system");
#endif #endif
// write GCC version // write GCC version
#ifndef __GNUC__ #if defined __GNUC__ && !defined __clang__
writeLog("Non-GCC compiler"); #ifdef __MINGW32__
#define COMPILER "MinGW GCC"
#else
#define COMPILER "GCC"
#endif
writeLog(QString("Compiled using %1 %2.%3.%4").arg(COMPILER).arg(__G
NUC__).arg(__GNUC_MINOR__).arg(__GNUC_PATCHLEVEL__));
#elif defined __clang__
writeLog(QString("Compiled using %1 %2.%3.%4").arg("Clang").arg(__cl
ang_major__).arg(__clang_minor__).arg(__clang_patchlevel__));
#else #else
writeLog(QString("Compiled with GCC %1.%2.%3").arg(__GNUC__).arg(__G NUC_MINOR__).arg(__GNUC_PATCHLEVEL__)); writeLog("Unknown compiler");
#endif #endif
// write Qt version // write Qt version
writeLog(QString("Qt runtime version: %1").arg(qVersion())); writeLog(QString("Qt runtime version: %1").arg(qVersion()));
writeLog(QString("Qt compilation version: %1").arg(QT_VERSION_STR)); writeLog(QString("Qt compilation version: %1").arg(QT_VERSION_STR));
// write addressing mode // write addressing mode
#ifdef __LP64__ #if defined(__LP64__) || defined(_WIN64)
writeLog("Addressing mode: 64-bit"); writeLog("Addressing mode: 64-bit");
#else #else
writeLog("Addressing mode: 32-bit"); writeLog("Addressing mode: 32-bit");
#endif #endif
// write memory and CPU info // write memory and CPU info
#ifdef Q_OS_LINUX #ifdef Q_OS_LINUX
#ifndef BUILD_FOR_MAEMO #ifndef BUILD_FOR_MAEMO
QFile infoFile("/proc/meminfo"); QFile infoFile("/proc/meminfo");
skipping to change at line 205 skipping to change at line 220
if(pciLines.at(i).contains("Kernel driver in use")) if(pciLines.at(i).contains("Kernel driver in use"))
writeLog(pciLines.at(i).trimmed()); writeLog(pciLines.at(i).trimmed());
else if(pciLines.at(i).contains("Kernel modu les")) else if(pciLines.at(i).contains("Kernel modu les"))
writeLog(pciLines.at(i).trimmed()); writeLog(pciLines.at(i).trimmed());
i++; i++;
} }
} }
} }
#endif #endif
// Aargh Windows API // Aargh Windows API
#elif defined Q_OS_WIN #elif defined Q_OS_WIN
// Hopefully doesn't throw a linker error on earlier systems. Not li ke // Hopefully doesn't throw a linker error on earlier systems. Not li ke
// I'm gonna test it or anything. // I'm gonna test it or anything.
if (QSysInfo::WindowsVersion >= QSysInfo::WV_2000) if (QSysInfo::WindowsVersion >= QSysInfo::WV_2000)
{ {
#ifdef __LP64__ #ifdef __LP64__
MEMORYSTATUSEX statex; MEMORYSTATUSEX statex;
GlobalMemoryStatusEx(&statex); GlobalMemoryStatusEx(&statex);
writeLog(QString("Total physical memory: %1 MB (unreliable)" ).arg(statex.ullTotalPhys/(1024<<10))); writeLog(QString("Total physical memory: %1 MB (unreliable)" ).arg(statex.ullTotalPhys/(1024<<10)));
writeLog(QString("Total virtual memory: %1 MB (unreliable)") .arg(statex.ullTotalVirtual/(1024<<10))); writeLog(QString("Total virtual memory: %1 MB (unreliable)") .arg(statex.ullTotalVirtual/(1024<<10)));
skipping to change at line 272 skipping to change at line 287
} }
RegCloseKey(hKey); RegCloseKey(hKey);
} }
if(i == 0) if(i == 0)
writeLog("Could not get processor info."); writeLog("Could not get processor info.");
#elif defined Q_OS_MAC #elif defined Q_OS_MAC
QProcess systemProfiler; QProcess systemProfiler;
systemProfiler.start("/usr/sbin/system_profiler -detailLevel mini SP HardwareDataType SPDisplaysDataType"); systemProfiler.start("/usr/sbin/system_profiler -detailLevel mini SP HardwareDataType SPDisplaysDataType");
systemProfiler.waitForStarted(); systemProfiler.waitForStarted();
systemProfiler.waitForFinished(); systemProfiler.waitForFinished();
const QString systemData(systemProfiler.readAllStandardOutput()); const QString systemData(systemProfiler.readAllStandardOutput());
QStringList systemLines = systemData.split('\n', QString::SkipEmptyP arts); QStringList systemLines = systemData.split('\n', QString::SkipEmptyP arts);
for (int i = 0; i<systemLines.size(); i++) for (int i = 0; i<systemLines.size(); i++)
{ {
if(systemLines.at(i).contains("Model")) if(systemLines.at(i).contains("Model"))
{ {
writeLog(systemLines.at(i).trimmed()); writeLog(systemLines.at(i).trimmed());
} }
skipping to change at line 299 skipping to change at line 314
{ {
writeLog(systemLines.at(i).trimmed()); writeLog(systemLines.at(i).trimmed());
} }
if(systemLines.at(i).contains("VRAM")) if(systemLines.at(i).contains("VRAM"))
{ {
writeLog(systemLines.at(i).trimmed()); writeLog(systemLines.at(i).trimmed());
} }
} }
//writeLog("You look like a Mac user. How would you like to write so
me system info code here? That would help a lot."); #elif defined Q_OS_BSD4
QProcess dmesg;
dmesg.start("/sbin/dmesg", QIODevice::ReadOnly);
dmesg.waitForStarted();
dmesg.waitForFinished();
const QString dmesgData(dmesg.readAll());
QStringList dmesgLines = dmesgData.split('\n', QString::SkipEmptyPar
ts);
for (int i = 0; i<dmesgLines.size(); i++)
{
if (dmesgLines.at(i).contains("memory"))
{
writeLog(dmesgLines.at(i).trimmed());
}
if (dmesgLines.at(i).contains("CPU"))
{
writeLog(dmesgLines.at(i).trimmed());
}
if (dmesgLines.at(i).contains("VGA"))
{
writeLog(dmesgLines.at(i).trimmed());
}
}
#endif #endif
} }
void StelLogger::deinit() void StelLogger::deinit()
{ {
qInstallMsgHandler(0); qInstallMsgHandler(0);
logFile.close(); logFile.close();
} }
 End of changes. 7 change blocks. 
8 lines changed or deleted 47 lines changed or added

This html diff was produced by rfcdiff 1.41. The latest version is available from http://tools.ietf.org/tools/rfcdiff/