void GdbCoreEngine::unpackCoreIfNeeded() { QStringList arguments; const QString msg = _("Unpacking core file to %1"); if (m_coreName.endsWith(QLatin1String(".lzo"))) { m_tempCoreName = tempCoreFilename(); showMessage(msg.arg(m_tempCoreName)); arguments << QLatin1String("-o") << m_tempCoreName << QLatin1String("-x") << m_coreName; m_coreUnpackProcess = new QProcess(this); m_coreUnpackProcess->setWorkingDirectory(QDir::tempPath()); m_coreUnpackProcess->start(QLatin1String("lzop"), arguments); connect(m_coreUnpackProcess, SIGNAL(finished(int)), SLOT(continueSetupEngine())); } else if (m_coreName.endsWith(QLatin1String(".gz"))) { m_tempCoreName = tempCoreFilename(); showMessage(msg.arg(m_tempCoreName)); m_tempCoreFile.setFileName(m_tempCoreName); m_tempCoreFile.open(QFile::WriteOnly); arguments << QLatin1String("-c") << QLatin1String("-d") << m_coreName; m_coreUnpackProcess = new QProcess(this); m_coreUnpackProcess->setWorkingDirectory(QDir::tempPath()); m_coreUnpackProcess->start(QLatin1String("gzip"), arguments); connect(m_coreUnpackProcess, SIGNAL(readyRead()), SLOT(writeCoreChunk())); connect(m_coreUnpackProcess, SIGNAL(finished(int)), SLOT(continueSetupEngine())); } else { continueSetupEngine(); } }
void GdbCoreEngine::unpackCoreIfNeeded() { if (!m_coreName.endsWith(QLatin1String(".lzo"))) { continueSetupEngine(); return; } { QString pattern = QDir::tempPath() + QLatin1String("/tmpcore-XXXXXX"); QTemporaryFile tmp(pattern, this); tmp.open(); m_tempCoreName = tmp.fileName(); } QProcess *process = new QProcess(this); process->setWorkingDirectory(QDir::tempPath()); QStringList arguments; arguments << QLatin1String("-o") << m_tempCoreName << QLatin1String("-x") << m_coreName; process->start(QLatin1String("/usr/bin/lzop"), arguments); connect(process, SIGNAL(finished(int)), SLOT(continueSetupEngine())); }