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

Port deprecated I18N_NOOP macro

parent 3a01af6d
......@@ -59,8 +59,11 @@ bool operator!=(const SConfig &s1, const SConfig &s2)
(s1.powerupShieldAmount != s2.powerupShieldAmount);
}
#if KI18N_VERSION < QT_VERSION_CHECK(5, 89, 0)
char ConfigSetup::LabelName[EditNum][25]=
#else
KLazyLocalizedString ConfigSetup::LabelName[EditNum] =
#endif
{
I18N_NOOP("Game speed:"), I18N_NOOP("Shot speed:"),
I18N_NOOP("Energy need:"), I18N_NOOP("Max number:"),
......@@ -153,7 +156,11 @@ ConfigSetup::ConfigSetup(SConfig *custom,QWidget *parent)
for(i=0;i<EditNum;++i)
{
label[i]=new QLabel(i18n(LabelName[i]),configWidgets[Parent[i]]);
#if KI18N_VERSION < QT_VERSION_CHECK(5, 89, 0)
label[i]=new QLabel(i18n(LabelName[i]),configWidgets[Parent[i]]);
#else
label[i]=new QLabel(KLocalizedString(LabelName[i]).toString(),configWidgets[Parent[i]]);
Please register or sign in to reply
#endif
slider[i]=new QSlider(Qt::Horizontal,configWidgets[Parent[i]]);
slider[i]->setRange((int)(EditVal[i][0]*EditDiv[i]), (int)(EditVal[i][1]*EditDiv[i]));
slider[i]->setPageStep((int)((EditVal[i][1]-EditVal[i][0])/10));
......@@ -167,7 +174,11 @@ ConfigSetup::ConfigSetup(SConfig *custom,QWidget *parent)
configCombo->setEditable(false);
connect(configCombo, static_cast<void(QComboBox::*)(int)>(&QComboBox::activated), this, &ConfigSetup::configSelected);
for(i=0;i<predefinedConfigNum;++i)
configCombo->addItem(i18n(predefinedConfigName[i]));
#if KI18N_VERSION < QT_VERSION_CHECK(5, 89, 0)
configCombo->addItem(i18n(predefinedConfigName[i]));
#else
configCombo->addItem(KLocalizedString(predefinedConfigName[i]).toString());
#endif
configCombo->addItem(i18nc("custom values","Custom"));
boxlayout->addSpacing( 2 * 6 );
......
......@@ -60,7 +60,12 @@ private:
TabShip,TabSun,TabStart,TabPowerups,TabNum};
enum Type {VarInt,VarFloat};
#if KI18N_VERSION < QT_VERSION_CHECK(5, 89, 0)
static char LabelName[EditNum][25];
#else
static KLazyLocalizedString LabelName[EditNum];
#endif
static int Parent[EditNum];
static int Position[EditNum];
static const char *TabName[TabNum];
......
......@@ -8,7 +8,12 @@
#define __SP_STRUCTS_H
#include <KLocalizedString>
#include <ki18n_version.h>
#if KI18N_VERSION >= QT_VERSION_CHECK(5, 89, 0)
#include <KLazyLocalizedString>
#undef I18N_NOOP
#define I18N_NOOP kli18n
#endif
struct SConfig
{
double gamespeed,gravity,acc,energyNeed,sunEnergy,rotationSpeed,
......@@ -48,7 +53,11 @@ const SConfig predefinedConfig[]={{1.0, 2200.0, 0.2, 1.0, 9000.0, 1.0,
500.0,10.0,10.0,
20, 50, 30, 5, 3,
400.0, 800.0, 50, 30}};
#if KI18N_VERSION < QT_VERSION_CHECK(5, 89, 0)
const char predefinedConfigName[predefinedConfigNum][15]=
#else
const KLazyLocalizedString predefinedConfigName[predefinedConfigNum] =
#endif
{I18N_NOOP("Default"),I18N_NOOP("Bullet"),I18N_NOOP("Chaos"),I18N_NOOP("Lack of Energy")};
// This is because on Solaris, sun is defined (it's the vendor)
......
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