Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
jami-client-qt
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
savoirfairelinux
jami-client-qt
Commits
af14a4a8
Commit
af14a4a8
authored
4 years ago
by
Sébastien Blin
Committed by
Adrien Béraud
4 years ago
Browse files
Options
Downloads
Patches
Plain Diff
screensaver: fix out-of-range exception
Change-Id: I0477ac00b68c0891ba04c9cbb2cc3221bff0cb24
parent
fa922325
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/screensaver.cpp
+11
-16
11 additions, 16 deletions
src/screensaver.cpp
with
11 additions
and
16 deletions
src/screensaver.cpp
+
11
−
16
View file @
af14a4a8
...
...
@@ -22,15 +22,16 @@
ScreenSaver
::
ScreenSaver
(
QObject
*
parent
)
#ifdef Q_OS_LINUX
:
QObject
(
parent
)
,
sessionBus_
(
QDBusConnection
::
sessionBus
())
,
screenSaverInterface_
(
nullptr
)
:
QObject
(
parent
)
,
sessionBus_
(
QDBusConnection
::
sessionBus
())
,
screenSaverInterface_
(
nullptr
)
{
request_
=
0u
;
createInterface
();
}
#else
:
QObject
(
parent
)
{}
:
QObject
(
parent
)
{}
#endif
#ifdef Q_OS_LINUX
...
...
@@ -42,12 +43,12 @@ ScreenSaver::createInterface(void)
return
false
;
}
for
(
int
i
=
0
;
i
<
=
N_SERVICES
;
i
++
)
{
for
(
int
i
=
0
;
i
<
N_SERVICES
;
i
++
)
{
screenSaverInterface_
=
new
QDBusInterface
(
services_
[
i
],
paths_
[
i
],
services_
[
i
],
sessionBus_
);
if
(
screenSaverInterface_
->
isValid
())
{
if
(
screenSaverInterface_
&&
screenSaverInterface_
->
isValid
())
{
qDebug
()
<<
"Screen saver dbus interface: "
<<
services_
[
i
];
return
true
;
}
...
...
@@ -72,17 +73,14 @@ ScreenSaver::inhibit(void)
}
}
QDBusReply
<
uint
>
reply
=
screenSaverInterface_
->
call
(
"Inhibit"
,
"jami-qt"
,
"In a call"
);
QDBusReply
<
uint
>
reply
=
screenSaverInterface_
->
call
(
"Inhibit"
,
"jami-qt"
,
"In a call"
);
if
(
reply
.
isValid
())
{
qDebug
()
<<
"Screen saver inhibited"
;
request_
=
static_cast
<
uint
>
(
reply
.
value
());
return
true
;
}
else
{
QDBusError
error
=
reply
.
error
();
qDebug
()
<<
"Error inhibiting screen saver: "
<<
error
.
message
()
<<
error
.
name
();
qDebug
()
<<
"Error inhibiting screen saver: "
<<
error
.
message
()
<<
error
.
name
();
}
#endif
return
false
;
...
...
@@ -102,17 +100,14 @@ ScreenSaver::uninhibit(void)
}
}
QDBusReply
<
void
>
reply
=
screenSaverInterface_
->
call
(
"UnInhibit"
,
static_cast
<
uint
>
(
request_
));
QDBusReply
<
void
>
reply
=
screenSaverInterface_
->
call
(
"UnInhibit"
,
static_cast
<
uint
>
(
request_
));
if
(
reply
.
isValid
())
{
qDebug
()
<<
"Screen saver uninhibited"
;
request_
=
0u
;
return
true
;
}
else
{
QDBusError
error
=
reply
.
error
();
qDebug
()
<<
"Error uninhibiting screen saver: "
<<
error
.
message
()
<<
error
.
name
();
qDebug
()
<<
"Error uninhibiting screen saver: "
<<
error
.
message
()
<<
error
.
name
();
}
request_
=
0u
;
#endif
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment