Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Resolve the issue of incomplete display of crash logs #245

Merged
merged 1 commit into from
Dec 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion application/displaycontent.cpp
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -2274,7 +2274,19 @@ void DisplayContent::slot_coredumpData(int index, QList<LOG_MSG_COREDUMP> list)
return;

m_coredumpList.append(list);
m_currentCoredumpList.append(filterCoredump(m_currentSearchStr, list));
QList<LOG_MSG_COREDUMP> filterList = filterCoredump(m_currentSearchStr, list);
m_currentCoredumpList.append(filterList);
//分页已到底部,来新数据时需要刷新到下一页
int value = m_treeView->verticalScrollBar()->value();
int maximum = m_treeView->verticalScrollBar()->maximum();
if (value == maximum && value > 0 && filterList.size() > 0) {
int rateValue = (m_treeViewLastScrollValue + 25) / SINGLE_LOAD;
int leftCnt = m_currentCoredumpList.count() - SINGLE_LOAD * rateValue;
int end = leftCnt > SINGLE_LOAD ? SINGLE_LOAD : leftCnt;
m_limitTag = rateValue;
insertCoredumpTable(m_currentCoredumpList, SINGLE_LOAD * rateValue, SINGLE_LOAD * rateValue + end);
}

//因为此槽会在同一次加载数据完成前触发数次,所以第一次收到数据需要更新界面状态,后面的话往model里塞数据就行
if (m_firstLoadPageData && !m_currentCoredumpList.isEmpty()) {
createCoredumpTable(m_currentCoredumpList);
Expand Down
6 changes: 3 additions & 3 deletions application/logauththread.cpp
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -1253,8 +1253,8 @@ void LogAuthThread::handleCoredump()
}

coredumpList.append(coredumpMsg);
//每获得500个数据就发出信号给控件加载
if (coredumpList.count() % SINGLE_READ_CNT == 0) {
//每获得600个数据就发出信号给控件加载
if (coredumpList.count() % SINGLE_READ_CNT_COREDUMP == 0) {
emit coredumpData(m_threadCount, coredumpList);
coredumpList.clear();
}
Expand All @@ -1263,7 +1263,7 @@ void LogAuthThread::handleCoredump()
if (!m_canRun) {
return;
}
//最后可能有余下不足500的数据
//最后可能有余下不足600的数据
if (coredumpList.count() >= 0) {
emit coredumpData(m_threadCount, coredumpList);
}
Expand Down
1 change: 1 addition & 0 deletions application/utils.h
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#ifndef UTILS_H
#define UTILS_H
#define SINGLE_READ_CNT 500
#define SINGLE_READ_CNT_COREDUMP 600
#include <QObject>
#include <QHash>
/**
Expand Down