Fix warnings when country or city is not present in the chart
This commit is contained in:
parent
c03ca6f517
commit
24c41fb3dd
@ -555,6 +555,8 @@ ag_window_set_house_system(GtkTreeModel *model,
|
|||||||
void
|
void
|
||||||
ag_window_update_from_chart(AgWindow *window)
|
ag_window_update_from_chart(AgWindow *window)
|
||||||
{
|
{
|
||||||
|
gchar *country,
|
||||||
|
*city;
|
||||||
AgWindowPrivate *priv = ag_window_get_instance_private(window);
|
AgWindowPrivate *priv = ag_window_get_instance_private(window);
|
||||||
GsweTimestamp *timestamp = gswe_moment_get_timestamp(
|
GsweTimestamp *timestamp = gswe_moment_get_timestamp(
|
||||||
GSWE_MOMENT(priv->chart)
|
GSWE_MOMENT(priv->chart)
|
||||||
@ -615,11 +617,30 @@ ag_window_update_from_chart(AgWindow *window)
|
|||||||
);
|
);
|
||||||
|
|
||||||
gtk_entry_set_text(GTK_ENTRY(priv->name), ag_chart_get_name(priv->chart));
|
gtk_entry_set_text(GTK_ENTRY(priv->name), ag_chart_get_name(priv->chart));
|
||||||
gtk_entry_set_text(
|
|
||||||
GTK_ENTRY(priv->country),
|
if ((country = ag_chart_get_country(priv->chart)) != NULL) {
|
||||||
ag_chart_get_country(priv->chart)
|
gtk_entry_set_text(
|
||||||
);
|
GTK_ENTRY(priv->country),
|
||||||
gtk_entry_set_text(GTK_ENTRY(priv->city), ag_chart_get_city(priv->chart));
|
ag_chart_get_country(priv->chart)
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
gtk_entry_set_text(
|
||||||
|
GTK_ENTRY(priv->country),
|
||||||
|
""
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((city = ag_chart_get_city(priv->chart)) != NULL) {
|
||||||
|
gtk_entry_set_text(
|
||||||
|
GTK_ENTRY(priv->city),
|
||||||
|
ag_chart_get_city(priv->chart)
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
gtk_entry_set_text(
|
||||||
|
GTK_ENTRY(priv->city),
|
||||||
|
""
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
if (ag_chart_get_note(priv->chart)) {
|
if (ag_chart_get_note(priv->chart)) {
|
||||||
// TODO: maybe setting length to -1 here is not that good of an idea…
|
// TODO: maybe setting length to -1 here is not that good of an idea…
|
||||||
|
Loading…
Reference in New Issue
Block a user