-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathconfig.cpp
53 lines (43 loc) · 1.45 KB
/
config.cpp
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
#include "config.h"
Config* Config::m_pInstance = NULL;
/********************************************************************************/
/* Config::Config() */
/********************************************************************************/
Config::Config()
{
unsavedChanges = false;
currentOpenedFile.clear();
}
void Config::setUnsavedChanges(bool bb)
{
saveChangesMutex.lockForWrite();
unsavedChanges = bb;
emit savedStatusChanged(bb);
saveChangesMutex.unlock();
}
bool Config::getUnsavedChanges()
{
saveChangesMutex.lockForRead();
bool res = unsavedChanges;
saveChangesMutex.unlock();
return res;
}
/********************************************************************************/
/* Config* Config::getInstance() */
/********************************************************************************/
Config* Config::getInstance()
{
if(NULL== m_pInstance )
{
m_pInstance = new Config();
}
return m_pInstance;
}
/********************************************************************************/
/* void Config::destroyInstance() */
/********************************************************************************/
void Config::destroyInstance()
{
delete m_pInstance;
m_pInstance = NULL;
}