Skip to content

Commit

Permalink
Merge branch 'master' into feat_accessbility
Browse files Browse the repository at this point in the history
  • Loading branch information
starhcq authored Aug 30, 2023
2 parents 49152d8 + 1914aa4 commit 07f2bdc
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 18 deletions.
4 changes: 2 additions & 2 deletions application/logapplicationhelper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -112,12 +112,12 @@ void LogApplicationHelper::initOtherLog()
m_other_log_list_temp.append(QStringList() << "iso-customizer-agent.log" << "/root/.cache/isocustomizer-agent/iso-customizer-agent/iso-customizer-agent.log");
m_other_log_list_temp.append(QStringList() << "downloader" << "~/.config/uos/downloader/Log");

m_other_log_list_temp.append(QStringList() << "kwin.log" << "~/kwin.log");
m_other_log_list_temp.append(QStringList() << ".kwin.log" << "~/.kwin.log");
m_other_log_list_temp.append(QStringList() << "audit.log" << "/var/log/audit/audit.log");
m_other_log_list_temp.append(QStringList() << "udcp-client" << "/var/log/udcp-client");

//窗管日志和配置文件监视
m_other_log_list_temp.append(QStringList() << "kwin_x11.log" << "~/kwin_x11.log");
m_other_log_list_temp.append(QStringList() << ".kwin_x11.log" << "~/.kwin_x11.log");
m_other_log_list_temp.append(QStringList() << "kwinrc" << "~/.config/kwinrc");
m_other_log_list_temp.append(QStringList() << "kglobalshortcutsrc" << "~/.config/kglobalshortcutsrc");
m_other_log_list_temp.append(QStringList() << "kwinrulesrc" << "~/.config/kwinrulesrc");
Expand Down
42 changes: 26 additions & 16 deletions application/logexportthread.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3359,8 +3359,11 @@ bool LogExportThread::exportToZip(const QString &fileName, const QList<LOG_MSG_C
Utils::mkMutiDir(tmpPath);

//复制文件
int nCoreDumpCount = 0;
for (auto &it : jList) {
DLDBusHandler::instance(this)->exportLog(tmpPath, it.storagePath, true);
if (it.coreFile == "present")
nCoreDumpCount++;
if (!m_canRunning) {
break;
}
Expand All @@ -3378,24 +3381,31 @@ bool LogExportThread::exportToZip(const QString &fileName, const QList<LOG_MSG_C

// refresh progress
bool ret = false;
connect(&procss, &QProcess::readyReadStandardOutput, this, [&](){
if (!m_canRunning) {
procss.kill();
ret = false;
return;
}

QByteArray dd = procss.readAllStandardOutput();
QList<QString> lines = QString(dd).split('\n', QString::SkipEmptyParts);
for (const QString &line : qAsConst(lines)) {
int pos = line.indexOf(QLatin1Char('%'));
if (pos > 1) {
int percentage = line.midRef(pos - 3, 3).toInt();
sigProgress(percentage, 100);
// 有coredump文件,才读取压缩进度
if (nCoreDumpCount > 0) {
connect(&procss, &QProcess::readyReadStandardOutput, this, [&](){
if (!m_canRunning) {
procss.kill();
ret = false;
return;
}
}

qInfo() << "recive proces done..";
QByteArray dd = procss.readAllStandardOutput();
QList<QString> lines = QString(dd).split('\n', QString::SkipEmptyParts);
for (const QString &line : qAsConst(lines)) {
int pos = line.indexOf(QLatin1Char('%'));
if (pos > 1) {
int percentage = line.midRef(pos - 3, 3).toInt();
sigProgress(percentage, 100);
}
}
ret = true;
});
} else {
ret = true;
});
}

procss.start("/bin/bash", arg);
procss.waitForFinished(-1);

Expand Down

0 comments on commit 07f2bdc

Please sign in to comment.