Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Education
Blinken
Commits
30588b37
Commit
30588b37
authored
Jul 23, 2020
by
Albert Astals Cid
Browse files
Port away from KRandom
parent
1382a024
Changes
2
Hide whitespace changes
Inline
Side-by-side
CMakeLists.txt
View file @
30588b37
...
...
@@ -9,8 +9,8 @@ set(RELEASE_SERVICE_VERSION "${RELEASE_SERVICE_VERSION_MAJOR}.${RELEASE_SERVICE_
project
(
blinken VERSION
${
RELEASE_SERVICE_VERSION
}
)
# minimal Qt requirement
set
(
QT_MIN_VERSION
"5.
9
.0"
)
set
(
KF5_MIN_VERSION
"5.
46
.0"
)
set
(
QT_MIN_VERSION
"5.
10
.0"
)
set
(
KF5_MIN_VERSION
"5.
55
.0"
)
# ECM
find_package
(
ECM
${
KF5_MIN_VERSION
}
REQUIRED NO_MODULE
)
...
...
src/blinkengame.cpp
View file @
30588b37
...
...
@@ -9,11 +9,9 @@
#include "blinkengame.h"
#include <stdlib.h> // for RAND_MAX
#include <QRandomGenerator>
#include <QTimer>
#include <KRandom>
#include "soundsplayer.h"
blinkenGame
::
blinkenGame
()
:
m_phase
(
starting
)
...
...
@@ -152,11 +150,10 @@ void blinkenGame::nextRound()
blinkenGame
::
color
blinkenGame
::
generateColor
()
{
int
r
;
// make the compiler happy :-D
color
c
=
none
;
r
=
1
+
(
int
)(
4.0
*
KRandom
::
random
()
/
(
RAND_MAX
+
1.0
));
const
int
r
=
QRandomGenerator
::
global
()
->
bounded
(
1
,
5
);
// rand [1, 5)
switch
(
r
)
{
case
1
:
...
...
Write
Preview
Supports
Markdown
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