Logo Search packages:      
Sourcecode: kallery version File versions  Download package

void HtmlOptionsPage::loadCountryList ( QComboBox *  combo  )  [private]

Load the list of avaliable countries and put them into a combo box This code is based on kdebase/kcontrol/locale/locale.cpp.

Parameters:
combo the combo where to put the result

Definition at line 255 of file htmloptionspage.cpp.

Referenced by setupPage().

{
  QString sub = QString::fromLatin1("l10n/");
  // clear the list
  combo->clear();
  // add all languages to the list
  QStringList countrylist = KGlobal::dirs()->findAllResources("locale",
                               sub + QString::fromLatin1("*/entry.desktop"));
  countrylist.sort();

  for(QStringList::ConstIterator it=++countrylist.begin();it!=countrylist.end();++it)
  {
    KSimpleConfig entry(*it);
    entry.setGroup(QString::fromLatin1("KCM Locale"));
    QString name = entry.readEntry(QString::fromLatin1("Name"),
                       KGlobal::locale()->translate("without name"));
    QString tag = *it;
    int index = tag.findRev('/');
    tag.truncate(index);
    index = tag.findRev('/');
    tag = tag.mid(index+1);
    combo->insertItem(name+" ("+tag+")");
  }
}


Generated by  Doxygen 1.6.0   Back to index