Skip to content
GitLab
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
114a2e31
Commit
114a2e31
authored
Feb 02, 2022
by
Laurent Montel
Browse files
Make it compiles against qt6
parent
bf33cfcc
Pipeline
#131929
passed with stage
in 33 seconds
Changes
5
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
CMakeLists.txt
View file @
114a2e31
...
...
@@ -10,7 +10,7 @@ project(blinken VERSION ${RELEASE_SERVICE_VERSION})
# minimal Qt requirement
set
(
QT_MIN_VERSION
"5.15.0"
)
set
(
KF5_MIN_VERSION
"5.
85
.0"
)
set
(
KF5_MIN_VERSION
"5.
90
.0"
)
# ECM
find_package
(
ECM
${
KF5_MIN_VERSION
}
REQUIRED NO_MODULE
)
...
...
@@ -27,13 +27,13 @@ include(ECMInstallIcons)
include
(
ECMSetupVersion
)
include
(
FeatureSummary
)
find_package
(
Qt
5
${
QT_MIN_VERSION
}
CONFIG REQUIRED Core Widgets Svg
)
find_package
(
Qt
${
QT_MAJOR_VERSION
}
${
QT_MIN_VERSION
}
CONFIG REQUIRED Core Widgets Svg
)
find_package
(
KF5
${
KF5_MIN_VERSION
}
REQUIRED COMPONENTS
I18n XmlGui GuiAddons DocTools DBusAddons Crash
)
find_package
(
Phonon4Qt
5
REQUIRED
)
find_package
(
Phonon4Qt
${
QT_MAJOR_VERSION
}
REQUIRED
)
# global include directories
include_directories
(
${
CMAKE_CURRENT_BINARY_DIR
}
)
...
...
src/CMakeLists.txt
View file @
114a2e31
...
...
@@ -32,7 +32,7 @@ target_link_libraries(blinken
KF5::I18n
KF5::XmlGui
KF5::GuiAddons
Qt
5
::Svg
Qt::Svg
KF5::DBusAddons
KF5::Crash
${
PHONON_LIBRARIES
}
...
...
src/blinken.cpp
View file @
114a2e31
...
...
@@ -40,7 +40,7 @@ static const double nonButtonRibbonY = 125.0;
blinken
::
blinken
()
:
m_overHighscore
(
false
),
m_overQuit
(
false
),
m_overCentralText
(
false
),
m_overMenu
(
false
),
m_overAboutKDE
(
false
),
m_overAboutBlinken
(
false
),
m_overSettings
(
false
),
m_overManual
(
false
),
m_overCentralLetters
(
false
),
m_overCounter
(
false
),
m_overFont
(
false
),
m_overSound
(
false
),
m_showPreferences
(
false
),
m_updateButtonHighlighting
(
false
),
m_highlighted
(
blinkenGame
::
none
)
{
m_renderer
=
new
QSvgRenderer
(
QStandardPaths
::
locate
(
QStandardPaths
::
DataLocation
,
QStringLiteral
(
"images/blinken.svg"
)));
m_renderer
=
new
QSvgRenderer
(
QStandardPaths
::
locate
(
QStandardPaths
::
AppLocal
DataLocation
,
QStringLiteral
(
"images/blinken.svg"
)));
m_buttons
[
0
]
=
new
button
(
blinkenGame
::
blue
);
m_buttons
[
1
]
=
new
button
(
blinkenGame
::
yellow
);
...
...
src/main.cpp
View file @
114a2e31
...
...
@@ -12,7 +12,9 @@
#include
<KLocalizedString>
#include
<KCrash>
#include
<KDBusService>
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
#include
<Kdelibs4ConfigMigrator>
#endif
#include
<QApplication>
#include
<QCommandLineParser>
...
...
@@ -34,10 +36,11 @@ int main(int argc, char *argv[])
KAboutData
::
setApplicationData
(
about
);
KCrash
::
initialize
();
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
Kdelibs4ConfigMigrator
migrate
(
QStringLiteral
(
"blinken"
));
migrate
.
setConfigFiles
(
QStringList
()
<<
QStringLiteral
(
"blinkenrc"
));
migrate
.
migrate
();
#endif
QCommandLineParser
parser
;
...
...
@@ -51,7 +54,7 @@ int main(int argc, char *argv[])
// Works with Steve may need some tweaking to work with other fonts
if
(
!
QFontInfo
(
f
).
exactMatch
())
{
QFontDatabase
::
addApplicationFont
(
QStandardPaths
::
locate
(
QStandardPaths
::
DataLocation
,
QStringLiteral
(
"fonts/steve.ttf"
)));
QFontDatabase
::
addApplicationFont
(
QStandardPaths
::
locate
(
QStandardPaths
::
AppLocal
DataLocation
,
QStringLiteral
(
"fonts/steve.ttf"
)));
}
KDBusService
service
;
new
blinken
();
...
...
src/soundsplayer.cpp
View file @
114a2e31
...
...
@@ -17,11 +17,11 @@ soundsPlayer::soundsPlayer()
Phonon
::
createPath
(
&
m_mediaObject
,
&
m_audioOutput
);
connect
(
&
m_mediaObject
,
&
Phonon
::
MediaObject
::
finished
,
this
,
&
soundsPlayer
::
playEnded
);
m_allSound
=
QStandardPaths
::
locate
(
QStandardPaths
::
DataLocation
,
QStringLiteral
(
"sounds/lose.wav"
));
m_greenSound
=
QStandardPaths
::
locate
(
QStandardPaths
::
DataLocation
,
QStringLiteral
(
"sounds/1.wav"
));
m_redSound
=
QStandardPaths
::
locate
(
QStandardPaths
::
DataLocation
,
QStringLiteral
(
"sounds/2.wav"
));
m_blueSound
=
QStandardPaths
::
locate
(
QStandardPaths
::
DataLocation
,
QStringLiteral
(
"sounds/3.wav"
));
m_yellowSound
=
QStandardPaths
::
locate
(
QStandardPaths
::
DataLocation
,
QStringLiteral
(
"sounds/4.wav"
));
m_allSound
=
QStandardPaths
::
locate
(
QStandardPaths
::
AppLocal
DataLocation
,
QStringLiteral
(
"sounds/lose.wav"
));
m_greenSound
=
QStandardPaths
::
locate
(
QStandardPaths
::
AppLocal
DataLocation
,
QStringLiteral
(
"sounds/1.wav"
));
m_redSound
=
QStandardPaths
::
locate
(
QStandardPaths
::
AppLocal
DataLocation
,
QStringLiteral
(
"sounds/2.wav"
));
m_blueSound
=
QStandardPaths
::
locate
(
QStandardPaths
::
AppLocal
DataLocation
,
QStringLiteral
(
"sounds/3.wav"
));
m_yellowSound
=
QStandardPaths
::
locate
(
QStandardPaths
::
AppLocal
DataLocation
,
QStringLiteral
(
"sounds/4.wav"
));
connect
(
&
m_warnTimer
,
&
QTimer
::
timeout
,
this
,
&
soundsPlayer
::
ended
);
m_warnTimer
.
setSingleShot
(
true
);
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment