aboutsummaryrefslogtreecommitdiff
path: root/libplanfahr/providers
diff options
context:
space:
mode:
authorGuido Günther <agx@sigxcpu.org>2014-03-22 22:27:40 +0100
committerGuido Günther <agx@sigxcpu.org>2014-03-22 22:27:40 +0100
commitb22e059f3100ac5f827a16bb9cd2c581772d6a6b (patch)
tree3ff3f13cbce9faedf86bb55ba18ce6502654c684 /libplanfahr/providers
parent06f5e18958d64a4db67382d03958f10127c4d9e6 (diff)
Allow to query trips by arrival instead of departure
Diffstat (limited to 'libplanfahr/providers')
-rw-r--r--libplanfahr/providers/hafas-bin6.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/libplanfahr/providers/hafas-bin6.c b/libplanfahr/providers/hafas-bin6.c
index 595c9c7..3389983 100644
--- a/libplanfahr/providers/hafas-bin6.c
+++ b/libplanfahr/providers/hafas-bin6.c
@@ -643,7 +643,7 @@ lpf_provider_hafas_bin6_get_trips (LpfProvider *self,
LpfLoc *start,
LpfLoc *end,
GDateTime *date,
- guint64 flags,
+ LpfProviderGetTripsFlags flags,
LpfProviderGotTripsNotify callback,
gpointer user_data)
{
@@ -656,7 +656,7 @@ lpf_provider_hafas_bin6_get_trips (LpfProvider *self,
/* allowed vehicle types */
const gchar *train_restriction = "11111111111111";
/* whether time is arrival or departure time */
- const gchar *by_departure = "1";
+ const gchar *by_departure;
char *start_id = NULL, *end_id = NULL;
g_return_val_if_fail (start, -1);
@@ -665,8 +665,6 @@ lpf_provider_hafas_bin6_get_trips (LpfProvider *self,
g_return_val_if_fail (priv->session, -1);
g_return_val_if_fail (date, -1);
- g_return_val_if_fail (!flags, 0);
-
g_object_ref (start);
g_object_ref (end);
g_date_time_ref (date);
@@ -684,9 +682,9 @@ lpf_provider_hafas_bin6_get_trips (LpfProvider *self,
g_warning ("Details missing.");
goto out;
}
+ by_departure = (flags & LPF_PROVIDER_GET_TRIPS_ARRIVAL) ? "0" : "1";
uri = soup_uri_new (lpf_provider_hafas_bin6_trips_url(LPF_PROVIDER_HAFAS_BIN6(self)));
-
soup_uri_set_query_from_fields (uri,
"start", "Suchen",
"REQ0JourneyStopsS0ID", start_id,