Commit 4f6c8a7b authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Port deprecated I18N_NOOP2

parent ab2cfec6
Pipeline #115673 passed with stage
in 1 minute and 53 seconds
......@@ -30,7 +30,10 @@
#include <QElapsedTimer>
#endif
#if KI18N_VERSION >= QT_VERSION_CHECK(5, 89, 0)
#undef I18N_NOOP2
#define I18N_NOOP2 kli18nc
#endif
namespace
{
const int FGCOLOR_INDEX = 0;
......@@ -119,7 +122,12 @@ const char *const ColorScheme::colorNames[TABLE_COLORS] = {
"Color6Faint",
"Color7Faint",
};
#if KI18N_VERSION >= QT_VERSION_CHECK(5, 89, 0)
const KLazyLocalizedString ColorScheme::translatedColorNames[TABLE_COLORS] = {
#else
const char *const ColorScheme::translatedColorNames[TABLE_COLORS] = {
#endif
I18N_NOOP2("@item:intable palette", "Foreground"),
I18N_NOOP2("@item:intable palette", "Background"),
I18N_NOOP2("@item:intable palette", "Color 1"),
......@@ -162,8 +170,11 @@ QString ColorScheme::colorNameForIndex(int index)
QString ColorScheme::translatedColorNameForIndex(int index)
{
Q_ASSERT(index >= 0 && index < TABLE_COLORS);
#if KI18N_VERSION >= QT_VERSION_CHECK(5, 89, 0)
return translatedColorNames[index].toString();
#else
return i18nc("@item:intable palette", translatedColorNames[index]);
#endif
}
ColorScheme::ColorScheme()
......
......@@ -19,6 +19,11 @@
// Konsole
#include "ColorSchemeWallpaper.h"
#include <ki18n_version.h>
#if KI18N_VERSION >= QT_VERSION_CHECK(5, 89, 0)
#include <KLazyLocalizedString>
#endif
class KConfig;
class QPixmap;
class QPainter;
......@@ -185,7 +190,11 @@ private:
ColorSchemeWallpaper::Ptr _wallpaper;
static const char *const colorNames[TABLE_COLORS];
#if KI18N_VERSION >= QT_VERSION_CHECK(5, 89, 0)
static const KLazyLocalizedString translatedColorNames[TABLE_COLORS];
#else
static const char *const translatedColorNames[TABLE_COLORS];
#endif
};
}
......
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