From: Angus Leeming Date: Thu, 14 Mar 2002 18:01:51 +0000 (+0000) Subject: Two little things: X-Git-Tag: 1.6.10~19645 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=b2f4586c984226bcc945d93891f3d0736d6ffb43;p=lyx.git Two little things: * Use Lars' preferred idiom for a for-loop in the graphics cache; * Turn the forked call controller's timer off when their are no longer any child processes running. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@3755 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/src/graphics/ChangeLog b/src/graphics/ChangeLog index 199c24fb37..072fd2e914 100644 --- a/src/graphics/ChangeLog +++ b/src/graphics/ChangeLog @@ -1,3 +1,7 @@ +2002-03-14 Angus Leeming + + * GraphicsCache.C: use Lars' preferred idiom for a for-loop. + 2002-03-11 Lars Gullik Bjønnes * GraphicsConverter.[Ch] (converted): make first arg const ref. diff --git a/src/graphics/GraphicsCache.C b/src/graphics/GraphicsCache.C index b478331033..0c86a59413 100644 --- a/src/graphics/GraphicsCache.C +++ b/src/graphics/GraphicsCache.C @@ -141,8 +141,9 @@ void GCache::changeDisplay(bool changed_background) GCache::CacheType::iterator GCache::find(InsetGraphics const & inset) { - CacheType::iterator it = cache->begin(); - for (; it != cache->end(); ++it) { + CacheType::iterator it = cache->begin(); + CacheType::iterator end = cache->end(); + for (; it != end; ++it) { if (it->second->referencedBy(inset)) return it; } @@ -154,8 +155,9 @@ GCache::find(InsetGraphics const & inset) GCache::CacheType::const_iterator GCache::find(InsetGraphics const & inset) const { - CacheType::const_iterator it = cache->begin(); - for (; it != cache->end(); ++it) { + CacheType::const_iterator it = cache->begin(); + CacheType::const_iterator end = cache->end(); + for (; it != end; ++it) { if (it->second->referencedBy(inset)) return it; } diff --git a/src/support/ChangeLog b/src/support/ChangeLog index 9876e26a6c..63350324ad 100644 --- a/src/support/ChangeLog +++ b/src/support/ChangeLog @@ -1,3 +1,8 @@ +2002-03-14 Angus Leeming + + * forkedcontr.C: turn the timer off when their are no longer any + child processes running. + 2002-03-11 Lars Gullik Bjønnes * forkedcall.h: docy fix diff --git a/src/support/forkedcontr.C b/src/support/forkedcontr.C index 13b397eb88..11cc31b4f1 100644 --- a/src/support/forkedcontr.C +++ b/src/support/forkedcontr.C @@ -45,7 +45,7 @@ ForkedcallsController & ForkedcallsController::get() ForkedcallsController::ForkedcallsController() { - timeout_ = new Timeout(100, Timeout::CONTINUOUS); + timeout_ = new Timeout(100, Timeout::ONETIME); timeout_->timeout .connect(SigC::slot(this, &ForkedcallsController::timer)); @@ -143,8 +143,8 @@ void ForkedcallsController::timer() } } - if (forkedCalls.empty()) { - timeout_->stop(); + if (!forkedCalls.empty()) { + timeout_->start(); } if (start_size != forkedCalls.size())