SANKORE-523

Changing the languages of the virtual keyboard crashes the software
preferencesAboutTextFull
Anatoly Mihalchenko 12 years ago
parent 5f30e45d97
commit b5d26ab5e5
  1. 40
      src/frameworks/UBPlatformUtils.h
  2. 10
      src/frameworks/UBPlatformUtils_linux.cpp
  3. 15
      src/frameworks/UBPlatformUtils_win.cpp

@ -19,6 +19,11 @@
#include <QtCore> #include <QtCore>
#include <QIcon> #include <QIcon>
#ifdef Q_WS_MACX
#import <Carbon/Carbon.h>
#endif
class QMainWindow; class QMainWindow;
#define SYMBOL_KEYS_COUNT 47 #define SYMBOL_KEYS_COUNT 47
@ -125,28 +130,31 @@ struct KEYBT
class UBKeyboardLocale class UBKeyboardLocale
{ {
public: public:
UBKeyboardLocale(const QString& _fullName, #ifdef Q_WS_MACX
const QString& _name, UBKeyboardLocale(const QString& _fullName,
const QString& _id, const QString& _name,
QIcon* _icon, TISInputSourceRef _tisInputSourceRef,
KEYBT** _symbols) QIcon* _icon,
:fullName(_fullName),name(_name), id(_id), icon(_icon), KEYBT** _symbols)
constSymbols(NULL), varSymbols(_symbols) :fullName(_fullName),name(_name), tisInputSourceRef(_tisInputSourceRef),
{} icon(_icon),constSymbols(NULL), varSymbols(_symbols)
UBKeyboardLocale(const QString& _fullName, {}
const QString& _name,
const QString& _id, TISInputSourceRef tisInputSourceRef;
QIcon* _icon, #else
KEYBT _symbols[]) UBKeyboardLocale(const QString& _fullName,
:fullName(_fullName),name(_name), id(_id), icon(_icon), const QString& _name,
QIcon* _icon,
KEYBT _symbols[])
:fullName(_fullName),name(_name), icon(_icon),
constSymbols(_symbols), varSymbols(NULL) constSymbols(_symbols), varSymbols(NULL)
{} {}
#endif
~UBKeyboardLocale(); ~UBKeyboardLocale();
const QString fullName; const QString fullName;
const QString name; const QString name;
const QString id;
QIcon* icon; QIcon* icon;
KEYBT* operator[] (int index) const KEYBT* operator[] (int index) const
{ {

@ -399,11 +399,11 @@ void UBPlatformUtils::initializeKeyboardLayouts()
{ {
nKeyboardLayouts = 5; nKeyboardLayouts = 5;
keyboardLayouts = new UBKeyboardLocale*[nKeyboardLayouts]; keyboardLayouts = new UBKeyboardLocale*[nKeyboardLayouts];
keyboardLayouts[0] = new UBKeyboardLocale(tr("English"), "en", "", new QIcon(":/images/flags/en.png"), ENGLISH_LOCALE); keyboardLayouts[0] = new UBKeyboardLocale(tr("English"), "en", new QIcon(":/images/flags/en.png"), ENGLISH_LOCALE);
keyboardLayouts[1] = new UBKeyboardLocale(tr("Russian"), "ru", "", new QIcon(":/images/flags/ru.png"),RUSSIAN_LOCALE); keyboardLayouts[1] = new UBKeyboardLocale(tr("Russian"), "ru", new QIcon(":/images/flags/ru.png"),RUSSIAN_LOCALE);
keyboardLayouts[2] = new UBKeyboardLocale(tr("German"), "de", "", new QIcon(":/images/flags/de.png"), GERMAN_LOCALE); keyboardLayouts[2] = new UBKeyboardLocale(tr("German"), "de", new QIcon(":/images/flags/de.png"), GERMAN_LOCALE);
keyboardLayouts[3] = new UBKeyboardLocale(tr("French"), "fr", "", new QIcon(":/images/flags/fr.png"), FRENCH_LOCALE); keyboardLayouts[3] = new UBKeyboardLocale(tr("French"), "fr", new QIcon(":/images/flags/fr.png"), FRENCH_LOCALE);
keyboardLayouts[4] = new UBKeyboardLocale(tr("Swiss French"), "fr-CH", "", new QIcon(":/images/flags/fr.png"), SWISS_FRENCH_LOCALE); keyboardLayouts[4] = new UBKeyboardLocale(tr("Swiss French"), "fr-CH", new QIcon(":/images/flags/fr.png"), SWISS_FRENCH_LOCALE);
} }
void UBPlatformUtils::destroyKeyboardLayouts() void UBPlatformUtils::destroyKeyboardLayouts()

@ -407,11 +407,16 @@ void UBPlatformUtils::initializeKeyboardLayouts()
{ {
nKeyboardLayouts = 5; nKeyboardLayouts = 5;
keyboardLayouts = new UBKeyboardLocale*[nKeyboardLayouts]; keyboardLayouts = new UBKeyboardLocale*[nKeyboardLayouts];
keyboardLayouts[0] = new UBKeyboardLocale(tr("English"), "en", "", new QIcon(":/images/flags/en.png"), ENGLISH_LOCALE); keyboardLayouts[0] = new UBKeyboardLocale(tr("English"),"en",
keyboardLayouts[1] = new UBKeyboardLocale(tr("Russian"), "ru", "", new QIcon(":/images/flags/ru.png"),RUSSIAN_LOCALE); new QIcon(":/images/flags/en.png"), ENGLISH_LOCALE);
keyboardLayouts[2] = new UBKeyboardLocale(tr("French"), "fr", "", new QIcon(":/images/flags/fr.png"), FRENCH_LOCALE); keyboardLayouts[1] = new UBKeyboardLocale(tr("Russian"), "ru",
keyboardLayouts[3] = new UBKeyboardLocale(tr("Swiss French"), "fr-CH", "", new QIcon(":/images/flags/fr.png"), SWISS_FRENCH_LOCALE); new QIcon(":/images/flags/ru.png"),RUSSIAN_LOCALE);
keyboardLayouts[4] = new UBKeyboardLocale(tr("German"), "de", "", new QIcon(":/images/flags/de.png"), GERMAN_LOCALE); keyboardLayouts[2] = new UBKeyboardLocale(tr("French"), "fr",
new QIcon(":/images/flags/fr.png"), FRENCH_LOCALE);
keyboardLayouts[3] = new UBKeyboardLocale(tr("Swiss French"), "fr-CH",
new QIcon(":/images/flags/fr.png"), SWISS_FRENCH_LOCALE);
keyboardLayouts[4] = new UBKeyboardLocale(tr("German"), "de",
new QIcon(":/images/flags/de.png"), GERMAN_LOCALE);
} }
void UBPlatformUtils::destroyKeyboardLayouts() void UBPlatformUtils::destroyKeyboardLayouts()

Loading…
Cancel
Save