mirror of
https://github.com/overte-org/overte.git
synced 2025-08-04 04:23:33 +02:00
fix LogDialog deadlock by removing unneeded mutex, closes #1624
This commit is contained in:
parent
120001ecac
commit
fb0f28cd7c
2 changed files with 1 additions and 6 deletions
|
@ -97,7 +97,7 @@ void LogDialog::initControls() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void LogDialog::showEvent(QShowEvent*) {
|
void LogDialog::showEvent(QShowEvent*) {
|
||||||
connect(_logger, SIGNAL(logReceived(QString)), this, SLOT(appendLogLine(QString)));
|
connect(_logger, SIGNAL(logReceived(QString)), this, SLOT(appendLogLine(QString)), Qt::QueuedConnection);
|
||||||
showLogData();
|
showLogData();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -111,11 +111,9 @@ void LogDialog::resizeEvent(QResizeEvent*) {
|
||||||
|
|
||||||
void LogDialog::appendLogLine(QString logLine) {
|
void LogDialog::appendLogLine(QString logLine) {
|
||||||
if (isVisible()) {
|
if (isVisible()) {
|
||||||
_mutex.lock();
|
|
||||||
if (logLine.contains(_searchTerm, Qt::CaseInsensitive)) {
|
if (logLine.contains(_searchTerm, Qt::CaseInsensitive)) {
|
||||||
_logTextBox->appendPlainText(logLine.simplified());
|
_logTextBox->appendPlainText(logLine.simplified());
|
||||||
}
|
}
|
||||||
_mutex.unlock();
|
|
||||||
_logTextBox->ensureCursorVisible();
|
_logTextBox->ensureCursorVisible();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -140,12 +138,10 @@ void LogDialog::handleSearchTextChanged(const QString searchText) {
|
||||||
|
|
||||||
void LogDialog::showLogData() {
|
void LogDialog::showLogData() {
|
||||||
_logTextBox->clear();
|
_logTextBox->clear();
|
||||||
_mutex.lock();
|
|
||||||
QStringList _logData = _logger->getLogData();
|
QStringList _logData = _logger->getLogData();
|
||||||
for (int i = 0; i < _logData.size(); ++i) {
|
for (int i = 0; i < _logData.size(); ++i) {
|
||||||
appendLogLine(_logData[i]);
|
appendLogLine(_logData[i]);
|
||||||
}
|
}
|
||||||
_mutex.unlock();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
KeywordHighlighter::KeywordHighlighter(QTextDocument *parent) : QSyntaxHighlighter(parent), keywordFormat() {
|
KeywordHighlighter::KeywordHighlighter(QTextDocument *parent) : QSyntaxHighlighter(parent), keywordFormat() {
|
||||||
|
|
|
@ -60,7 +60,6 @@ private:
|
||||||
QCheckBox* _extraDebuggingBox;
|
QCheckBox* _extraDebuggingBox;
|
||||||
QPushButton* _revealLogButton;
|
QPushButton* _revealLogButton;
|
||||||
QPlainTextEdit* _logTextBox;
|
QPlainTextEdit* _logTextBox;
|
||||||
QMutex _mutex;
|
|
||||||
QString _searchTerm;
|
QString _searchTerm;
|
||||||
KeywordHighlighter* _highlighter;
|
KeywordHighlighter* _highlighter;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue