FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
TaskExplorer/TaskExplorer/API/PersistentPreset.cpp at master · imhugy/TaskExplorer · GitHub
imhugy
/
TaskExplorer
Public
forked from
DavidXanatos/TaskExplorer
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
TaskExplorer
/
TaskExplorer
/
API
/
PersistentPreset.cpp
Copy path
More file actions
More file actions
Latest commit
History
History
History
48 lines (39 loc) · 1.63 KB
Breadcrumbs
TaskExplorer
/
TaskExplorer
/
API
/
PersistentPreset.cpp
Copy path
File metadata and controls
48 lines (39 loc) · 1.63 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
#
include
"
stdafx.h
"
#
include
"
PersistentPreset.h
"
CPersistentPreset::CPersistentPreset
(
const
QString Pattern)
{
m_Data =
new
CPersistentPresetData
();
m_Data->
sPattern
= Pattern;
}
CPersistentPreset::~CPersistentPreset
()
{
}
bool
CPersistentPreset::Test
(
const
QString& FileName,
const
QString& CommandLine)
{
QReadLocker
Locker
(&m_Mutex);
QRegExp
RegExp
(m_Data->
sPattern
, Qt::CaseInsensitive, QRegExp::WildcardUnix);
return
RegExp.
exactMatch
(FileName) || RegExp.
exactMatch
(CommandLine);
}
QVariantMap
CPersistentPreset::Store
()
const
{
QReadLocker
Locker
(&m_Mutex);
QVariantMap Map;
Map[
"
Pattern
"
] = m_Data->
sPattern
;
if
(m_Data->
bTerminate
) Map[
"
Terminate
"
] =
true
;
if
(m_Data->
bPriority
) Map[
"
CpuPriority
"
] = m_Data->
iPriority
;
if
(m_Data->
bAffinity
) Map[
"
CpuAffinity
"
] = m_Data->
uAffinity
;
if
(m_Data->
bIOPriority
) Map[
"
IoPriority
"
] = m_Data->
iIOPriority
;
if
(m_Data->
bPagePriority
) Map[
"
PagePriority
"
] = m_Data->
iPagePriority
;
return
Map;
}
bool
CPersistentPreset::Load
(
const
QVariantMap& Map)
{
QWriteLocker
Locker
(&m_Mutex);
m_Data->
sPattern
= Map[
"
Pattern
"
].
toString
();
m_Data->
bTerminate
= Map[
"
Terminate
"
].
toBool
();
if
(m_Data->
bPriority
= Map.
contains
(
"
CpuPriority
"
)) m_Data->
iPriority
= Map[
"
CpuPriority
"
].
toInt
();
if
(m_Data->
bAffinity
= Map.
contains
(
"
CpuAffinity
"
)) m_Data->
uAffinity
= Map[
"
CpuAffinity
"
].
toULongLong
();
if
(m_Data->
bIOPriority
= Map.
contains
(
"
IoPriority
"
)) m_Data->
iIOPriority
= Map[
"
IoPriority
"
].
toInt
();
if
(m_Data->
bPagePriority
= Map.
contains
(
"
PagePriority
"
)) m_Data->
iPagePriority
= Map[
"
PagePriority
"
].
toInt
();
return
!m_Data->
sPattern
.
isEmpty
();
}
Back
|
FazBrowse Home
|
New Git URL