From 06bd6096a4da30f2430bc35aa60d1412f00022eb Mon Sep 17 00:00:00 2001 From: Peter Landgren Date: Sat, 8 Oct 2011 14:23:00 +0000 Subject: [PATCH] Issue 5275, problem when lat/long has wrong format in place view. svn: r18262 --- src/gui/views/treemodels/placemodel.py | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/src/gui/views/treemodels/placemodel.py b/src/gui/views/treemodels/placemodel.py index b91a8f8af..8c80e6dcf 100644 --- a/src/gui/views/treemodels/placemodel.py +++ b/src/gui/views/treemodels/placemodel.py @@ -138,16 +138,28 @@ class PlaceBaseModel(object): return unicode(data[2]) def column_longitude(self, data): - return conv_lat_lon('0', data[3], format='DEG')[1] + value = conv_lat_lon('0', data[3], format='DEG')[1] + if not value: + return _("Error in format") + return value def column_latitude(self, data): - return conv_lat_lon(data[4], '0', format='DEG')[0] + value = conv_lat_lon(data[4], '0', format='DEG')[0] + if not value: + return _("Error in format") + return value def sort_longitude(self, data): - return conv_lat_lon('0', data[3], format='ISO-DMS') if data[3] else u'' + value = conv_lat_lon('0', data[3], format='ISO-DMS') if data[3] else u'' + if not value: + return _("Error in format") + return value def sort_latitude(self, data): - return conv_lat_lon(data[4], '0', format='ISO-DMS') if data[4] else u'' + value = conv_lat_lon(data[4], '0', format='ISO-DMS') if data[4] else u'' + if not value: + return _("Error in format") + return value def column_id(self, data): return unicode(data[1])