23 #include <klistview.h>
25 #include <kstandarddirs.h>
26 #include <ktimezones.h>
27 #include <ktimezonewidget.h>
32 #define COLUMN_REGION 1
33 #define COLUMN_COMMENT 2
41 bool userDb = (db != 0);
49 const KTimezones::ZoneMap zones = db->
allZones();
50 for (KTimezones::ZoneMap::ConstIterator it = zones.begin(); it != zones.end(); ++it)
53 TQString tzName = zone->
name();
54 TQString comment = zone->
comment();
55 if (!comment.isEmpty())
56 comment = i18n(comment.utf8());
62 TQStringList continentCity = TQStringList::split(
"/",
displayName(zone));
63 TQListViewItem *listItem =
new TQListViewItem(
this, continentCity[continentCity.count() - 1]);
64 continentCity[continentCity.count() - 1] = zone->
countryCode();
65 listItem->setText(COLUMN_REGION, continentCity.join(
"/"));
66 listItem->setText(COLUMN_COMMENT, comment);
67 listItem->setText(COLUMN_ZONE, tzName);
70 TQString flag =
locate(
"locale", TQString(
"l10n/%1/flag.png").arg(zone->
countryCode().lower()));
71 if (TQFile::exists(flag))
72 listItem->setPixmap(COLUMN_REGION, TQPixmap(flag));
88 return i18n(zone->
name().utf8()).replace(
"_",
" ");
96 TQListViewItem *listItem = firstChild();
99 if (listItem->isSelected())
101 selection.append(listItem->text(COLUMN_ZONE));
103 listItem = listItem->nextSibling();
113 TQListViewItem *listItem = firstChild();
116 if (listItem->text(COLUMN_ZONE) == zone)
118 KListView::setSelected(listItem, selected);
121 listItem = selectedItem();
123 ensureItemVisible(listItem);
127 listItem = listItem->nextSibling();
133 #include "ktimezonewidget.moc"