SANKORE-523

Changing the languages of the virtual keyboard crashes the software
preferencesAboutTextFull
Anatoly Mihalchenko 12 years ago
parent 1596b37896
commit 5f30e45d97
  1. 5
      src/frameworks/UBPlatformUtils_mac.mm
  2. 1
      src/gui/UBKeyboardPalette_mac.cpp

@ -440,6 +440,9 @@ void UBPlatformUtils::initializeKeyboardLayouts()
int count = CFArrayGetCount(kbds); int count = CFArrayGetCount(kbds);
QList<UBKeyboardLocale*> result; QList<UBKeyboardLocale*> result;
qDebug() << "initializeKeyboardLayouts";
qDebug() << "Found system locales: " << count;
for(int i=0; i<count; i++) for(int i=0; i<count; i++)
{ {
TISInputSourceRef keyLayoutRef = (TISInputSourceRef)CFArrayGetValueAtIndex(kbds, i); TISInputSourceRef keyLayoutRef = (TISInputSourceRef)CFArrayGetValueAtIndex(kbds, i);
@ -530,6 +533,8 @@ void UBPlatformUtils::initializeKeyboardLayouts()
const QString resName = ":/images/flags/" + name + ".png"; const QString resName = ":/images/flags/" + name + ".png";
QIcon *iconLang = new QIcon(resName); QIcon *iconLang = new QIcon(resName);
qDebug() << "Locale: " << ID << ", name: " << name;
result.append(new UBKeyboardLocale(fullName, name, ID, iconLang, keybt)); result.append(new UBKeyboardLocale(fullName, name, ID, iconLang, keybt));
} }

@ -60,6 +60,7 @@ void UBKeyboardPalette::createCtrlButtons()
void SetMacLocaleByIdentifier(const QString& id) void SetMacLocaleByIdentifier(const QString& id)
{ {
const char * strName = id.toAscii().data(); const char * strName = id.toAscii().data();
CFStringRef iName = CFStringCreateWithCString(NULL, strName, kCFStringEncodingMacRoman ); CFStringRef iName = CFStringCreateWithCString(NULL, strName, kCFStringEncodingMacRoman );
CFStringRef keys[] = { kTISPropertyInputSourceCategory, kTISPropertyInputSourceID }; CFStringRef keys[] = { kTISPropertyInputSourceCategory, kTISPropertyInputSourceID };

Loading…
Cancel
Save