-
Notifications
You must be signed in to change notification settings - Fork 5
/
QtResourcePolicy.rtf
86 lines (79 loc) · 2.66 KB
/
QtResourcePolicy.rtf
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
76
77
78
79
80
81
82
83
84
85
86
{\rtf1\ansi\ansicpg1252\cocoartf1187\cocoasubrtf390
{\fonttbl\f0\fnil\fcharset0 Menlo-Regular;\f1\fnil\fcharset0 Menlo-Bold;\f2\fmodern\fcharset0 Courier;
}
{\colortbl;\red255\green255\blue255;\red56\green56\blue59;\red255\green255\blue193;\red83\green83\blue83;
\red23\green36\blue104;\red179\green179\blue179;\red107\green0\blue3;\red0\green0\blue109;\red109\green111\blue5;
\red107\green0\blue109;\red15\green112\blue3;}
\paperw11900\paperh16840\margl1440\margr1440\vieww10800\viewh8400\viewkind0
\deftab720
\pard\pardeftab720\sl360
{\field{\*\fldinst{HYPERLINK "https://qt.gitorious.org/qt-mobility/qt-mobility/source/76e3fb9c7c73d30306cdd3584b31b8f6dc52ba5a:plugins/multimedia/gstreamer/camerabin/camerabinresourcepolicy.cpp#L203-215"}}{\fldrslt
\f0\fs24 \cf2 https://qt.gitorious.org/qt-mobility/qt-mobility/source/76e3fb9c7c73d30306cdd3584b31b8f6dc52ba5a:plugins/multimedia/gstreamer/camerabin/camerabinresourcepolicy.cpp#L203-215}}
\f0\fs24 \cf2 \
\
resource\cb3 \cf4 \cb1 =\cf2 \cb3
\f1\b \cf5 \cb1 new
\f0\b0 \cf2 \cb3 \cb1 ResourcePolicy\cf4 ::\cf2 LedsResource;\
m_resource\cf4 ->\cf2 addResourceObject(resource);\
m_resource\cf4 ->\cf2 update();\
m_resource\cf4 ->\cf2 acquire();\
\
\
//////////////////////////\
\
.cpp
\f2 \cf6 \
\
construrctor\
\pard\pardeftab720
\cf7 ledsResource\cf0 (\cf8 0\cf0 ),\cf6 \cf0 \
\pard\pardeftab720\sl360
\cf6 \
\cf0 initResource();\
\f0 \cf2 \
\pard\pardeftab720
\f2 \cf9 void\cf6 \cf10 GstTorch\cf0 ::initResource()\cf6 \cf0 \{\
\
\pard\pardeftab720
\cf6 \cf9 if\cf6 \cf0 (\cf7 ledsResource\cf0 ->isGranted())\{\
\cf6 \cf8 qDebug\cf0 ()\cf6 \cf0 <<\cf6 \cf11 "LED\cf6 \cf11 Resource\cf6 \cf11 granted"\cf0 ;\
\cf6 \cf0 \}\cf6 \cf9 else\cf6 \cf0 \{\
\cf6 \cf8 qDebug\cf0 ()\cf6 \cf0 <<\cf6 \cf11 "LED\cf6 \cf11 Resource\cf6 \cf11 NOT\cf6 \cf11 granted"\cf0 ;\
\cf6 \cf9 delete\cf6 \cf7 ledsResource\cf0 ;\
\cf6 \cf9 return\cf0 ;\
\cf6 \cf0 \}\
\}\
\pard\pardeftab720\sl360
\f0 \cf2 \
deconstructor\
\pard\pardeftab720
\f2 \cf6 \cf9 delete\cf6 \cf0 ledsResource;\
\pard\pardeftab720\sl360
\f0 \cf2 \
\
.h file\
\pard\pardeftab720
\f2 \cf8 #include\cf6 \cf11 <policy/resources.h>\cf0 \
\
\pard\pardeftab720
\cf9 using\cf6 \cf9 namespace\cf6 \cf0 ResourcePolicy;\
\pard\pardeftab720
\cf6 \
\
\cf0 LedsResource\cf6 \cf0 *\cf7 ledsResource\cf0 ;\
\pard\pardeftab720\sl360
\f0 \cf2 \
.yaml\
libresourceqt-qt5-devel\
libresourceqt-qt5\
\
//////////////////\
\
\
\
\
\
\
\
Nemo Version\
{\field{\*\fldinst{HYPERLINK "https://github.com/nemomobile/nemo-qml-plugin-policy/blob/master/src/permissions.h"}}{\fldrslt https://github.com/nemomobile/nemo-qml-plugin-policy/blob/master/src/permissions.h}}}