Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Sign in / Register
Toggle navigation
Akabei core library
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Insights
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Locked Files
Issues
9
Issues
9
List
Boards
Labels
Service Desk
Milestones
Merge Requests
2
Merge Requests
2
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Security & Compliance
Security & Compliance
Dependency List
Packages
Packages
Container Registry
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Chakra
Akabei
Akabei core library
Commits
e1784cbd
Commit
e1784cbd
authored
Mar 05, 2016
by
Luca Giambonini
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
replace qDebug with akabeiDebug and added more clear debug output text
parent
45173d67
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
8 deletions
+8
-8
lib/akabeibackend.cpp
lib/akabeibackend.cpp
+8
-8
No files found.
lib/akabeibackend.cpp
View file @
e1784cbd
...
...
@@ -224,10 +224,10 @@ void Backend::setStatus(Backend::Status s, QObject * cO, const char * cS)
d
->
callbackSlot
=
cS
;
if
(
Config
::
instance
()
->
needsPrivileges
())
{
q
Debug
()
<<
"We need privileges to get lock"
;
akabei
Debug
()
<<
"We need privileges to get lock"
;
if
(
Akabei
::
Helpers
::
checkAuthorizationSync
(
"org.chakraproject.akabeicorehelper.filesystem.lock"
))
{
setStatus
(
Backend
::
StatusWaitingForLock
);
qDebug
()
<<
"Authorization granted"
;
akabeiDebug
()
<<
"Authorization granted"
;
if
(
!
d
->
iface
)
{
d
->
iface
=
new
QDBusInterface
(
"org.chakraproject.akabeicorehelper"
,
"/filesystem"
,
"org.chakraproject.akabeicorehelper.filesystem"
,
QDBusConnection
::
systemBus
());
}
...
...
@@ -238,7 +238,7 @@ void Backend::setStatus(Backend::Status s, QObject * cO, const char * cS)
d
->
iface
->
asyncCall
(
"getLock"
,
QCoreApplication
::
applicationPid
());
}
else
{
q
Debug
()
<<
"Authorization not granted"
<<
PolkitQt1
::
Authority
::
instance
()
->
errorDetails
();
akabei
Debug
()
<<
"Authorization not granted"
<<
PolkitQt1
::
Authority
::
instance
()
->
errorDetails
();
Akabei
::
ErrorQueue
::
instance
()
->
appendError
(
Error
(
Error
::
PermissionError
,
tr
(
"An authorization error occurred: %1"
).
arg
(
PolkitQt1
::
Authority
::
instance
()
->
errorDetails
())));
setStatus
(
Backend
::
StatusBroken
);
}
...
...
@@ -246,7 +246,7 @@ void Backend::setStatus(Backend::Status s, QObject * cO, const char * cS)
AkabeiLogLine
::
initialize
(
Akabei
::
Config
::
instance
()
->
useSyslog
(),
Akabei
::
Config
::
instance
()
->
logFile
()
);
return
;
}
else
{
qDebug
()
<<
"WE HERE
"
;
akabeiDebug
()
<<
"We have privileges, now try get the lock
"
;
if
(
!
d
->
lockFileHandle
)
{
d
->
lockFileHandle
=
new
QFile
(
Akabei
::
Config
::
instance
()
->
rootDir
().
absoluteFilePath
(
"var/local/akabei.lck"
));
...
...
@@ -268,7 +268,7 @@ void Backend::setStatus(Backend::Status s, QObject * cO, const char * cS)
setStatus
(
Backend
::
StatusWaitingForLock
);
if
(
fcntl
(
d
->
lockFileHandle
->
handle
(),
F_SETLK
,
&
lockinfo
)
==
-
1
)
{
akabeiDebug
()
<<
"
No lock for us
!"
;
akabeiDebug
()
<<
"
Already locked, waiting for it...
!"
;
connect
(
&
d
->
lockWatcher
,
SIGNAL
(
finished
()),
this
,
SLOT
(
__k__lockGranted
()));
//TODO: Check if this works!!!!!
QFuture
<
void
>
lockF
=
QtConcurrent
::
run
(
d
,
&
BackendPrivate
::
getLock
);
d
->
lockWatcher
.
setFuture
(
lockF
);
...
...
@@ -281,14 +281,14 @@ void Backend::setStatus(Backend::Status s, QObject * cO, const char * cS)
return
;
}
else
if
(
d
->
status
==
StatusOnTransaction
)
{
if
(
Config
::
instance
()
->
needsPrivileges
())
{
q
Debug
()
<<
"We need privileges to remove lock"
;
akabei
Debug
()
<<
"We need privileges to remove lock"
;
if
(
Akabei
::
Helpers
::
checkAuthorizationSync
(
"org.chakraproject.akabeicorehelper.filesystem.lock"
))
{
q
Debug
()
<<
"Authorization granted"
;
akabei
Debug
()
<<
"Authorization granted"
;
disconnect
(
d
->
iface
,
SIGNAL
(
lockGranted
(
qlonglong
)),
this
,
SLOT
(
__k__lockGranted
(
qlonglong
)));
QDBusMessage
mes
=
d
->
iface
->
call
(
"removeLock"
,
QCoreApplication
::
applicationPid
());
}
else
{
q
Debug
()
<<
"Authorization not granted"
<<
PolkitQt1
::
Authority
::
instance
()
->
errorDetails
();
akabei
Debug
()
<<
"Authorization not granted"
<<
PolkitQt1
::
Authority
::
instance
()
->
errorDetails
();
setStatus
(
Backend
::
StatusBroken
);
Akabei
::
ErrorQueue
::
instance
()
->
appendError
(
Error
(
Error
::
PermissionError
,
PolkitQt1
::
Authority
::
instance
()
->
errorDetails
()));
return
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment