Commit 114a2e31 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Make it compiles against qt6

parent bf33cfcc
Pipeline #131929 passed with stage
in 33 seconds
......@@ -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 (Qt5 ${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 (Phonon4Qt5 REQUIRED)
find_package (Phonon4Qt${QT_MAJOR_VERSION} REQUIRED)
# global include directories
include_directories (${CMAKE_CURRENT_BINARY_DIR})
......
......@@ -32,7 +32,7 @@ target_link_libraries(blinken
KF5::I18n
KF5::XmlGui
KF5::GuiAddons
Qt5::Svg
Qt::Svg
KF5::DBusAddons
KF5::Crash
${PHONON_LIBRARIES}
......
......@@ -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::AppLocalDataLocation, QStringLiteral("images/blinken.svg")));
m_buttons[0] = new button(blinkenGame::blue);
m_buttons[1] = new button(blinkenGame::yellow);
......
......@@ -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::AppLocalDataLocation, QStringLiteral("fonts/steve.ttf")));
}
KDBusService service;
new blinken();
......
......@@ -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::AppLocalDataLocation, QStringLiteral("sounds/lose.wav"));
m_greenSound = QStandardPaths::locate(QStandardPaths::AppLocalDataLocation, QStringLiteral("sounds/1.wav"));
m_redSound = QStandardPaths::locate(QStandardPaths::AppLocalDataLocation, QStringLiteral("sounds/2.wav"));
m_blueSound = QStandardPaths::locate(QStandardPaths::AppLocalDataLocation, QStringLiteral("sounds/3.wav"));
m_yellowSound = QStandardPaths::locate(QStandardPaths::AppLocalDataLocation, QStringLiteral("sounds/4.wav"));
connect(&m_warnTimer, &QTimer::timeout, this, &soundsPlayer::ended);
m_warnTimer.setSingleShot(true);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment