mirror of https://github.com/KLayout/klayout.git
More frequent updates of in-window log.
This commit is contained in:
parent
47e110115f
commit
726fe40e22
|
|
@ -120,9 +120,8 @@ LogFile::LogFile (size_t max_entries, bool register_global)
|
||||||
{
|
{
|
||||||
connect (&m_timer, SIGNAL (timeout ()), this, SLOT (timeout ()));
|
connect (&m_timer, SIGNAL (timeout ()), this, SLOT (timeout ()));
|
||||||
|
|
||||||
m_timer.setSingleShot (false);
|
m_timer.setSingleShot (true);
|
||||||
m_timer.setInterval (100);
|
m_timer.setInterval (0);
|
||||||
m_timer.start ();
|
|
||||||
|
|
||||||
if (register_global) {
|
if (register_global) {
|
||||||
tl::info.add (&m_info_receiver, false);
|
tl::info.add (&m_info_receiver, false);
|
||||||
|
|
@ -253,30 +252,10 @@ LogFile::add (LogFileEntry::mode_type mode, const std::string &msg, bool continu
|
||||||
void
|
void
|
||||||
LogFile::yield ()
|
LogFile::yield ()
|
||||||
{
|
{
|
||||||
#if 0
|
// will update on next processEvents
|
||||||
// This looked like a good idea, but in fact it introduces a hell lot of instability
|
if (lay::ApplicationBase::instance ()->qapp_gui () && QThread::currentThread () == lay::ApplicationBase::instance ()->qapp_gui ()->thread ()) {
|
||||||
// as it potentially leads to a recursion of events inside innocent functions. Remember
|
m_timer.start ();
|
||||||
// that log output may be generated from every function called in response of an event
|
|
||||||
// and not every such function may process further events
|
|
||||||
|
|
||||||
bool can_yield = false;
|
|
||||||
|
|
||||||
{
|
|
||||||
QMutexLocker locker (&m_lock);
|
|
||||||
|
|
||||||
if (lay::ApplicationBase::instance ()->qapp_gui () && QThread::currentThread () == lay::ApplicationBase::instance ()->qapp_gui ()->thread () && (tl::Clock::current () - m_last_yield).seconds () > 0.1) {
|
|
||||||
m_last_yield = tl::Clock::current ();
|
|
||||||
can_yield = true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// use this opportunity to process events
|
|
||||||
// NOTE: as process events may trigger further log output, it's necessary to do process events outside any other
|
|
||||||
// method (e.g. add) which is subject to locking. Hence we avoid deadlocks.
|
|
||||||
if (can_yield) {
|
|
||||||
lay::ApplicationBase::instance ()->process_events (QEventLoop::ExcludeUserInputEvents | QEventLoop::ExcludeSocketNotifiers, true /*silent*/);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,6 @@
|
||||||
|
|
||||||
#include "ui_LogViewerDialog.h"
|
#include "ui_LogViewerDialog.h"
|
||||||
#include "tlLog.h"
|
#include "tlLog.h"
|
||||||
#include "tlTimer.h"
|
|
||||||
#include "layCommon.h"
|
#include "layCommon.h"
|
||||||
|
|
||||||
#include <QTimer>
|
#include <QTimer>
|
||||||
|
|
@ -233,7 +232,6 @@ private:
|
||||||
size_t m_last_generation_id;
|
size_t m_last_generation_id;
|
||||||
bool m_has_errors, m_has_warnings;
|
bool m_has_errors, m_has_warnings;
|
||||||
bool m_last_attn;
|
bool m_last_attn;
|
||||||
tl::Clock m_last_yield;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Adds an error
|
* @brief Adds an error
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue