qDebug() << __PRETTY_FUNCTION__;
setSubitemTextWidth(LOCATION_SUBITEM_TEXT_MAX_WIDTH);
- addSubItem(QString("Hei pitka teksti hep hep hep hep hep hep hep hep hep hep hep hep"),
- QPixmap(":/res/images/clock.png"));
- addSubItem(QString("Hep"));
- addSubItem(QString("Jep"), QPixmap(":/res/images/compass.png"));
}
GeoCoordinate LocationListItem::coordinates()
{
m_location = location;
- setName(shortenText("blaah bavlsdfasdfhldsaf dsafldsaf ldsa lfadsl fl sadf",
- ITEM_WIDTH - 3*MARGIN, ListItem::TEXT_SIZE_NORMAL));
+ QStringList addressComponents = m_location.addressComponents();
+
+ if (addressComponents.count() > 0)
+ setName(shortenText(addressComponents.at(0), ITEM_WIDTH - 3*MARGIN,
+ ListItem::TEXT_SIZE_NORMAL));
+
+ QString addressTail;
+
+ for (int i = 1; i < addressComponents.count(); ++i) {
+ addressTail.append(addressComponents.at(i));
+
+ if (i < (addressComponents.count() - 1))
+ addressTail.append(", ");
+ }
+
+ addSubItem(addressTail, QPixmap(":/res/images/compass.png"));
+
+}
+
+void LocationListItem::bounds(GeoCoordinate &swBound, GeoCoordinate &neBound)
+{
+ m_location.bounds(swBound, neBound);
}