[utilities/ktrip] src/qml: Add mode filter option for ride sharing

Volker Krause <[email protected]>
Newsgroups gmane.comp.kde.cvs
Message-ID <[email protected]>
Git commit c482722f6162b2f370ed5a181e2551856ed19741 by Volker Krause.
Committed on 26/07/2026 at 16:04.
Pushed by vkrause into branch 'master'.

Add mode filter option for ride sharing

Meanwhile supported by Transitous as well as some OTP instances.

M  +13   -1    src/qml/QueryPage.qml

https://invent.kde.org/utilities/ktrip/-/commit/c482722f6162b2f370ed5a181e2551856ed19741

diff --git a/src/qml/QueryPage.qml b/src/qml/QueryPage.qml
index 5871f87..c40ed88 100644
--- a/src/qml/QueryPage.qml
+++ b/src/qml/QueryPage.qml
@@ -48,7 +48,7 @@ FormCard.FormCardPage {
     // either true/false if all mode switches are in that position, undefined otherwise
     function fullModeSwitchState() {
         let state = longDistanceSwitch.checked;
-        for (const s of [localTrainSwitch, rapidTransitSwitch, busSwitch, ferrySwitch]) {
+        for (const s of [localTrainSwitch, rapidTransitSwitch, busSwitch, ferrySwitch, rideshareSwitch, aircraftSwitch]) {
             if (s.checked != state) {
                 return undefined;
             }
@@ -203,6 +203,8 @@ FormCard.FormCardPage {
                         lineModes.push(PublicTransport.Line.Bus, PublicTransport.Line.Coach);
                     if (ferrySwitch.checked)
                         lineModes.push(PublicTransport.Line.Ferry, PublicTransport.Line.Boat);
+                    if (rideshareSwitch.checked)
+                        lineModes.push(PublicTransport.Line.RideShare);
                     if (aircraftSwitch.checked)
                         lineModes.push(PublicTransport.Line.Air);
                 }
@@ -270,6 +272,16 @@ FormCard.FormCardPage {
                 isMask: true
             }
         }
+        FormCard.FormSwitchDelegate {
+            id: rideshareSwitch
+            text: i18nc("journey query search constraint, title", "Ride sharing")
+            description: i18nc("journey query search constraint, description", "Hitch a ride")
+            checked: false
+            leading: Kirigami.Icon {
+                source: PublicTransport.LineMode.iconName(PublicTransport.Line.RideShare)
+                isMask: true
+            }
+        }
         FormCard.FormSwitchDelegate {
             id: aircraftSwitch
             text: i18nc("journey query search constraint, title", "Airplane")
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.