From e1ba5c2389b2d5849c945deeb2df4887db9e153d Mon Sep 17 00:00:00 2001 From: Paolo Cignoni cignoni Date: Fri, 20 Apr 2007 09:57:00 +0000 Subject: [PATCH] Smarter Callback that does not slow down the system when called too frequently --- src/meshlab/mainwindow_RunTime.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/meshlab/mainwindow_RunTime.cpp b/src/meshlab/mainwindow_RunTime.cpp index 72ef3dce1..88e1f71d2 100644 --- a/src/meshlab/mainwindow_RunTime.cpp +++ b/src/meshlab/mainwindow_RunTime.cpp @@ -24,6 +24,9 @@ History $Log$ +Revision 1.127 2007/04/20 09:57:00 cignoni +Smarter Callback that does not slow down the system when called too frequently + Revision 1.126 2007/04/16 09:24:37 cignoni ** big change ** Added Layers managemnt. @@ -504,6 +507,13 @@ void MainWindow::applyDecorateMode() bool MainWindow::QCallBack(const int pos, const char * str) { + int static lastPos=-1; + if(pos==lastPos) return true; + lastPos=pos; + + static QTime currTime; + if(currTime.elapsed()< 100) return true; + currTime.start(); MainWindow::globalStatusBar()->showMessage(str,5000); qb->show(); qb->setEnabled(true);