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

List:       kde-commits
Subject:    kdesdk/kbabel
From:       Stanislav Visnovsky <visnovsky () nenya ! ms ! mff ! cuni ! cz>
Date:       2002-12-16 14:18:58
[Download RAW message or body]

CVS commit by nanulo: 

Fix GNU plurals for automatic determination of number of plural forms


  M +5 -0      common/catalog.cpp   1.93
  M +5 -0      common/catalog.h   1.43
  M +3 -3      kbabel/hidingmsgedit.cpp   1.4
  M +2 -2      kbabel/kbabelview.cpp   1.189


--- kdesdk/kbabel/common/catalog.cpp  #1.92:1.93
@@ -3650,4 +3650,9 @@ QValueList<DiffEntry> Catalog::asDiffLis
 }
 
+int Catalog::defaultNumberOfPluralForms() const
+{
+    return d->numberOfPluralForms;
+}
+
 void Catalog::getNumberOfPluralForms()
 {

--- kdesdk/kbabel/common/catalog.h  #1.42:1.43
@@ -231,4 +231,9 @@ public:
    PluralFormType pluralForm(uint index) const;
    int numberOfPluralForms(uint index) const;
+   
+   /**
+   * returns the expected number of plural forms
+   */
+   int defaultNumberOfPluralForms() const;
 
 

--- kdesdk/kbabel/kbabel/hidingmsgedit.cpp  #1.3:1.4
@@ -66,8 +66,8 @@ void HidingMsgEdit::setText(QStringList 
       if( _numberOfPlurals )
       {
-          for( uint i=0 ; i < _numberOfPlurals ; i++ )
+          QStringList::iterator text = texts.begin();
+          for( uint i=0 ; i < _numberOfPlurals && text!= texts.end() ; i++, text++ )
           {
-              //FIXME: at() is slow
-              static_cast<QTextEdit \
*>(_multipleEdit->page(i))->setText(*texts.at(i)); +              \
static_cast<QTextEdit *>(_multipleEdit->page(i))->setText(*text);  }
       }

--- kdesdk/kbabel/kbabel/kbabelview.cpp  #1.188:1.189
@@ -191,5 +191,5 @@ of the currently displayed entry.</p></q
     layout=new QVBoxLayout(tempWidget);
 
-    msgstrEdit = new HidingMsgEdit( \
_catalog->identitySettings().numberOfPluralForms,tempWidget,"msgstrEdit"); +    \
msgstrEdit = new HidingMsgEdit( \
_catalog->defaultNumberOfPluralForms(),tempWidget,"msgstrEdit");  \
msgstrEdit->installEventFilter(this);  KCursor::setAutoHideCursor(msgstrEdit,true);


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

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