[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-core-devel
Subject:    patch: kxkb misbehavior when localized
From:       Vojtech Bubnik <bubnikv () suse ! cz>
Date:       2000-10-06 6:48:14
[Download RAW message or body]

Hi, 

In the last snapshot of czech catalogs, I found out (and lot of other Czechs), that
my keyboard model in kxkb is allways set to Brazillian. The bug was that the keyboard
model strings were not allways "delocalized". The patch is attached.

I fixed another bug. Kxkb was run from control center kxkb plugin by 
kapp->startServiceByDesktopName("kxkb");
This will run kxkb only when it is not run yet. But kxkb is designed to reread 
it's configuration, when it is run as a second instance. I fixed it to 
kapp->kdeinitExec("kxkb"); 
I hope this is the right way. It works well.

At the end, I fixed the "Czechoslovakian" to "Czech" and "Slovak" keyboard, 
because there is no czechoslovakian keyboard. 

Should I apply?



Index: kxkb/kcmlayout.cpp
===================================================================
RCS file: /home/kde/kdebase/kxkb/kcmlayout.cpp,v
retrieving revision 1.12
diff -u -b -r1.12 kcmlayout.cpp
--- kxkb/kcmlayout.cpp	2000/09/23 13:13:55	1.12
+++ kxkb/kcmlayout.cpp	2000/10/05 16:26:48
@@ -129,7 +129,7 @@
   return QString::null;
 }
 
-QString lookupLayout(const QDict<char> &dict, QString text)
+QString lookupLocalized(const QDict<char> &dict, QString text)
 {
 
   QDictIterator<char> it(dict);
@@ -170,7 +170,7 @@
   // should ask the X-server about it's settings!
 
   QString m_name = rules->models()[model];
-  setCurrent(modelCombo, m_name);
+  setCurrent(modelCombo, i18n(m_name.local8Bit()));
 
   QString l_name = rules->layouts()[layout];
   setCurrent(layoutCombo, i18n(l_name.local8Bit()));
@@ -207,8 +207,8 @@
   QString model, layout;
   if (rules)
     {
-      model = lookup(rules->models(), modelCombo->currentText());
-      layout = lookupLayout(rules->layouts(), layoutCombo->currentText());
+      model = lookupLocalized(rules->models(), modelCombo->currentText());
+      layout = lookupLocalized(rules->layouts(), layoutCombo->currentText());
     }
 
   delete rules;
@@ -255,8 +255,8 @@
   config->setGroup("Layout");
   //  config->writeEntry("Rule", ruleCombo->currentText());
 
-  config->writeEntry("Model", lookup(rules->models(), modelCombo->currentText()));
-  config->writeEntry("Layout", lookupLayout(rules->layouts(), layoutCombo->currentText()));
+  config->writeEntry("Model", lookupLocalized(rules->models(), modelCombo->currentText()));
+  config->writeEntry("Layout", lookupLocalized(rules->layouts(), layoutCombo->currentText()));
 
   config->writeEntry("Test", "Test");
 
@@ -266,7 +266,7 @@
     {
       QCheckListItem *cli = (QCheckListItem*) item;
       if (cli->isOn())
-	tmp.append(lookupLayout(rules->layouts(), cli->text(2)));
+	tmp.append(lookupLocalized(rules->layouts(), cli->text(2)));
       item = item->nextSibling();
     }
   config->writeEntry("Additional", tmp);
@@ -277,7 +277,7 @@
 
   delete config;
 
-  kapp->startServiceByDesktopName("kxkb");
+  kapp->kdeinitExec("kxkb");
 }
 
 
Index: kxkb/pixmap.cpp
===================================================================
RCS file: /home/kde/kdebase/kxkb/pixmap.cpp,v
retrieving revision 1.3
diff -u -b -r1.3 pixmap.cpp
--- kxkb/pixmap.cpp	2000/09/23 13:13:55	1.3
+++ kxkb/pixmap.cpp	2000/10/05 16:26:48
@@ -75,7 +75,8 @@
   (void) i18n("Swiss German");
   (void) i18n("Canadian");
   (void) i18n("U.S. English");
-  (void) i18n("Czechoslovakian");
+  (void) i18n("Czech");
+  (void) i18n("Slovak");
   (void) i18n("Brazilian");
   (void) i18n("U.S. English w/ISO9995-3");
 



-- 

Regards, 

Vojtech Bubnik
developer
---------------------------------------------------------------------
SuSE CR, s.r.o.                               e-mail: bubnikv@suse.cz
Pod Pekarnami 338/12                          tel:+420 2 6603 2619
190 00 Praha 9 - Vysocany                     fax:+420 2 6603 2620
Czech Republic                                http://www.suse.cz

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic