这是一个用来监控本地文件夹变化的服务
w1146869587
2021-11-09 f5e3a3a6785cd9305c476eadf329c8ae00161add
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
#include "mbwatchmgr.h"
 
CMBWatchMgr::CMBWatchMgr()
{
    m_pConst     = new CMBWatchConst();
 
    m_pTaskMgr   = new CMBTaskMgr();
    m_pMdWare    = new CMBMdware();
    m_pTaskMgr->setMdWare(m_pMdWare);
 
    m_pUserMgr   = new CMBWatchUserMgr();
    m_pUserDb    = new CMBWatchUserDb();
    m_pUserDb->setUserMgr(m_pUserMgr);
}
 
CMBWatchMgr::~CMBWatchMgr()
{
    if( m_pConst ){
        delete m_pConst;
        m_pConst = NULL;
    }
    if( m_pUserDb ){
        delete m_pUserDb;
        m_pUserDb = NULL;
    }
    if(m_pUserMgr){
        delete m_pUserMgr;
        m_pUserMgr = NULL;
    }
    if( m_pTaskMgr ){
        delete m_pTaskMgr;
        m_pTaskMgr = NULL;
    }
 
    if( m_pMdWare ){
        delete m_pMdWare;
        m_pMdWare = NULL;
    }
}
 
CMBWatchConst *CMBWatchMgr::getConst()
{
    return m_pConst;
}
 
CMBWatchUserMgr *CMBWatchMgr::getUserMgr()
{
    return m_pUserMgr;
}
 
CMBTaskMgr *CMBWatchMgr::getTaskMgr()
{
    return m_pTaskMgr;
}
 
CMBMdware *CMBWatchMgr::getMdWare()
{
    return m_pMdWare;
}
 
bool CMBWatchMgr::init(QString &errInfo)
{
    QString watchUserDB = m_pConst->getWatchUserDB();
    if(!m_pUserDb->init(watchUserDB,errInfo))
        return false;
 
    return true;
}
 
bool CMBWatchMgr::stop()
{
    m_pTaskMgr->stopThread();
 
    return true;
}