We used to hide the whole location vbox if no field was displayed in the
location table (such as street, city, etc).
But if contact only publishes it's lat and lon, we can at least display the
map widget. (#611062)
};
int i;
const gchar *skey;
+ gboolean display_map = FALSE;
if (!(information->flags & EMPATHY_CONTACT_WIDGET_SHOW_LOCATION))
{
row++;
}
- if (row == 0)
+#if HAVE_LIBCHAMPLAIN
+ if (has_position &&
+ !(information->flags & EMPATHY_CONTACT_WIDGET_FOR_TOOLTIP))
+ {
+ /* Cannot be displayed in tooltips until Clutter-Gtk can deal with such
+ * windows */
+ display_map = TRUE;
+ }
+#endif
+
+ if (row > 0)
+ {
+ /* We can display some fields */
+ gtk_widget_show (information->table_location);
+ }
+ else if (!display_map)
{
+ /* Can't display either fields or map */
gtk_widget_hide (information->vbox_location);
return;
}
- gtk_widget_show (information->table_location);
-
#if HAVE_LIBCHAMPLAIN
- /* Cannot be displayed in tooltips until Clutter-Gtk can deal with such
- * windows
- */
- if (has_position &&
- !(information->flags & EMPATHY_CONTACT_WIDGET_FOR_TOOLTIP))
+ if (display_map)
{
ClutterActor *marker;
ChamplainLayer *layer;