Commit b020d757 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Make it compile with last kf5 version

parent 7e7061d6
......@@ -9,7 +9,7 @@ set(RELEASE_SERVICE_VERSION "${RELEASE_SERVICE_VERSION_MAJOR}.${RELEASE_SERVICE_
project(ktuberling VERSION ${RELEASE_SERVICE_VERSION})
set (QT_MIN_VERSION "5.15.0")
set (KF5_MIN_VERSION "5.83.0")
set (KF5_MIN_VERSION "5.85.0")
find_package(ECM ${KF5_MIN_VERSION} REQUIRED CONFIG)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${ECM_MODULE_PATH} )
......@@ -47,7 +47,6 @@ ecm_setup_version(${RELEASE_SERVICE_VERSION} VARIABLE_PREFIX KTUBERLING VERSION_
add_definitions(-DQT_USE_FAST_CONCATENATION -DQT_USE_FAST_OPERATOR_PLUS)
add_subdirectory(sounds)
add_subdirectory(pics)
if(KF5DocTools_FOUND)
......
......@@ -31,8 +31,8 @@ int main(int argc, char *argv[])
KLocalizedString::setApplicationDomain("ktuberling");
KAboutData aboutData( QStringLiteral("ktuberling"), i18n("KTuberling"),
KTUBERLING_VERSION_STRING, i18n("Potato game for kids"), KAboutLicense::GPL,
KAboutData aboutData( QStringLiteral("ktuberling"), i18n("KTuberling"),
QLatin1String(KTUBERLING_VERSION_STRING), i18n("Potato game for kids"), KAboutLicense::GPL,
i18n("(c) 1999-2009, The KTuberling Developers"));
aboutData.addAuthor(i18n("Albert Astals Cid"), i18n("Maintainer"), QStringLiteral("aacid@kde.org"));
aboutData.addAuthor(i18n("Éric Bischoff"), i18n("Former Developer"), QStringLiteral("ebischoff@nerim.net"));
......
......@@ -51,7 +51,7 @@ PlayGround::PlayGround(PlayGroundCallbacks *callbacks, QWidget *parent)
// Destructor
PlayGround::~PlayGround()
{
foreach (const SceneData &data, m_scenes)
for (const SceneData &data : std::as_const(m_scenes))
{
delete data.scene;
delete data.undoStack;
......@@ -62,7 +62,8 @@ PlayGround::~PlayGround()
void PlayGround::reset()
{
foreach(QGraphicsItem *item, scene()->items())
const auto items = scene()->items();
for (QGraphicsItem *item : items )
{
ToDraw *currentObject = qgraphicsitem_cast<ToDraw *>(item);
delete currentObject;
......@@ -83,7 +84,8 @@ bool PlayGround::saveAs(const QString & name)
out.setVersion(QDataStream::Qt_4_5);
out << QString::fromLatin1(saveGameText);
out << gameBoard.fileName();
foreach(QGraphicsItem *item, scene()->items())
const auto items = scene()->items();
for (QGraphicsItem *item : items)
{
ToDraw *currentObject = qgraphicsitem_cast<ToDraw *>(item);
if (currentObject != NULL) currentObject->save(out);
......@@ -318,18 +320,18 @@ void PlayGround::registerPlayGrounds()
{
QSet<QString> list;
const QStringList dirs = FileFactory::locateAll(QStringLiteral("pics"));
Q_FOREACH (const QString &dir, dirs)
for (const QString &dir : dirs)
{
const QStringList fileNames = QDir(dir).entryList(QStringList() << QStringLiteral("*.theme"));
Q_FOREACH (const QString &file, fileNames)
for (const QString &file : fileNames)
{
list << dir + '/' + file;
list << dir + QLatin1Char('/') + file;
}
}
QMultiMap<QString, QPair<QString, QPixmap>> sortedByName;
foreach(const QString &theme, list)
for(const QString &theme : std::as_const(list))
{
QFile layoutFile(theme);
if (layoutFile.open(QIODevice::ReadOnly))
......
......@@ -58,16 +58,16 @@ void SoundFactory::registerLanguages()
{
QSet<QString> list;
const QStringList dirs = FileFactory::locateAll(QStringLiteral("sounds"));
Q_FOREACH (const QString &dir, dirs)
for (const QString &dir : dirs)
{
const QStringList fileNames = QDir(dir).entryList(QStringList() << QStringLiteral("*.soundtheme"));
Q_FOREACH (const QString &file, fileNames)
for (const QString &file : fileNames)
{
list <<dir + '/' + file;
list <<dir + QLatin1Char('/') + file;
}
}
foreach(const QString &soundTheme, list)
for(const QString &soundTheme : std::as_const(list))
{
QFile file(soundTheme);
if (file.open(QIODevice::ReadOnly))
......
......@@ -419,7 +419,7 @@ void TopLevel::filePicture()
QStringList patterns;
for(const auto &mimeName : imageWriterMimetypes)
{
const QMimeType mime = mimedb.mimeTypeForName(mimeName);
const QMimeType mime = mimedb.mimeTypeForName(QString::fromLatin1(mimeName));
if (mime.isValid())
{
QStringList suffixes;
......@@ -429,7 +429,7 @@ void TopLevel::filePicture()
}
// Favor png
const QString pattern = i18nc("%1 is mimetype and %2 is the file extensions", "%1 (%2)", mime.comment(), suffixes.join(' '));
const QString pattern = i18nc("%1 is mimetype and %2 is the file extensions", "%1 (%2)", mime.comment(), suffixes.join(QLatin1Char(' ')));
if (mimeName == "image/png")
{
patterns.prepend(pattern);
......
......@@ -44,10 +44,10 @@ protected:
void writeOptions();
void setupKAction();
protected slots:
protected Q_SLOTS:
void saveNewToolbarConfig() override;
private slots:
private Q_SLOTS:
void fileNew();
void fileOpen();
......
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