summaryrefslogtreecommitdiffstats
path: root/src/k9updatefactor.cpp
blob: 74dba8a093cd212f2823b9ccad9eedf93a32d0b3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
//
// C++ Implementation: k9updatefactor
//
// Description: 
//
//
// Author: Jean-Michel PETIT <k9copy@free.fr>, (C) 2007
//
// Copyright: See COPYING file that comes with this distribution
//
//
#include "k9updatefactor.h"

k9UpdateFactor::k9UpdateFactor(TQObject *tqparent, const char *name)
 : TQObject(tqparent, name), TQThread()
{
}


k9UpdateFactor::~k9UpdateFactor()
{
   wait();
}

void k9UpdateFactor::run(){
    do  {
    	m_restart=false;
    	emit updateFactor_internal();
    } while (m_restart);
}

void k9UpdateFactor::updateFactor() {
   m_mutex.lock();
   if (running()) {
   	m_restart=true;
   }
   else
   	start();
   m_mutex.unlock();
}


#include "k9updatefactor.moc"