StelLogger.cpp   StelLogger.cpp 
skipping to change at line 17 skipping to change at line 17
* as published by the Free Software Foundation; either version 2 * as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version. * of the License, or (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, U SA. * Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA 02110-1335, USA.
*/ */
#include "StelLogger.hpp" #include "StelLogger.hpp"
#include <QDateTime> #include <QDateTime>
#include <QProcess> #include <QProcess>
#ifdef Q_OS_WIN #ifdef Q_OS_WIN
#include <windows.h> #include <windows.h>
#endif #endif
skipping to change at line 94 skipping to change at line 94
break; break;
case QSysInfo::MV_10_4: case QSysInfo::MV_10_4:
writeLog("Mac OS X 10.4"); writeLog("Mac OS X 10.4");
break; break;
case QSysInfo::MV_10_5: case QSysInfo::MV_10_5:
writeLog("Mac OS X 10.5"); writeLog("Mac OS X 10.5");
break; break;
case QSysInfo::MV_10_6: case QSysInfo::MV_10_6:
writeLog("Mac OS X 10.6"); writeLog("Mac OS X 10.6");
break; break;
#ifdef MV_10_7
case QSysInfo::MV_10_7:
writeLog("Mac OS X 10.7");
break;
#endif
default: default:
writeLog("Unsupported Mac version"); writeLog("Unsupported Mac version");
break; break;
} }
#elif defined Q_OS_LINUX #elif defined Q_OS_LINUX
QFile procVersion("/proc/version"); QFile procVersion("/proc/version");
if(!procVersion.open(QIODevice::ReadOnly | QIODevice::Text)) if(!procVersion.open(QIODevice::ReadOnly | QIODevice::Text))
writeLog("Unknown Linux version"); writeLog("Unknown Linux version");
else else
skipping to change at line 169 skipping to change at line 174
QString line = infoFile.readLine(); QString line = infoFile.readLine();
line.chop(1); line.chop(1);
if(line.startsWith("model name") || line.startsWith( "cpu MHz")) if(line.startsWith("model name") || line.startsWith( "cpu MHz"))
writeLog(line); writeLog(line);
} }
infoFile.close(); infoFile.close();
} }
QProcess lspci; QProcess lspci;
lspci.start("lspci -v", QIODevice::ReadOnly); lspci.start("lspci -v", QIODevice::ReadOnly);
lspci.waitForFinished(200); lspci.waitForFinished(300);
const QString pciData(lspci.readAll()); const QString pciData(lspci.readAll());
QStringList pciLines = pciData.split('\n', QString::SkipEmptyParts); QStringList pciLines = pciData.split('\n', QString::SkipEmptyParts);
for (int i = 0; i<pciLines.size(); i++) for (int i = 0; i<pciLines.size(); i++)
{ {
if(pciLines.at(i).contains("VGA compatible controller")) if(pciLines.at(i).contains("VGA compatible controller"))
{ {
writeLog(pciLines.at(i)); writeLog(pciLines.at(i));
i++; i++;
while(i < pciLines.size() && pciLines.at(i).startsWi th('\t')) while(i < pciLines.size() && pciLines.at(i).startsWi th('\t'))
{ {
skipping to change at line 255 skipping to change at line 260
else else
writeLog("Could not get processor name."); writeLog("Could not get processor name.");
} }
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
writeLog("You look like a Mac user. How would you like to write some QProcess systemProfiler;
system info code here? That would help a lot."); systemProfiler.start("/usr/sbin/system_profiler -detailLevel mini SP
HardwareDataType SPDisplaysDataType");
systemProfiler.waitForStarted();
systemProfiler.waitForFinished();
const QString systemData(systemProfiler.readAllStandardOutput());
QStringList systemLines = systemData.split('\n', QString::SkipEmptyP
arts);
for (int i = 0; i<systemLines.size(); i++)
{
if(systemLines.at(i).contains("Model"))
{
writeLog(systemLines.at(i).trimmed());
}
if(systemLines.at(i).contains("Processor"))
{
writeLog(systemLines.at(i).trimmed());
}
if(systemLines.at(i).contains("Memory"))
{
writeLog(systemLines.at(i).trimmed());
}
if(systemLines.at(i).contains("VRAM"))
{
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.");
#endif #endif
} }
void StelLogger::deinit() void StelLogger::deinit()
{ {
qInstallMsgHandler(0); qInstallMsgHandler(0);
logFile.close(); logFile.close();
} }
 End of changes. 4 change blocks. 
4 lines changed or deleted 40 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/