[pim/itinerary] src/app: Add ride sharing mode filter

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

Add ride sharing mode filter

M  +10   -0    src/app/AlternativeJourneyPage.qml
M  +10   -0    src/app/DepartureQueryPage.qml
M  +13   -0    src/app/JourneyFilterPage.qml

https://invent.kde.org/pim/itinerary/-/commit/cde52e2757bab010d4e8395c4dc2f9fce4ff8c9f

diff --git a/src/app/AlternativeJourneyPage.qml b/src/app/AlternativeJourneyPage.qml
index 41c0d0cdf..3b16ad084 100644
--- a/src/app/AlternativeJourneyPage.qml
+++ b/src/app/AlternativeJourneyPage.qml
@@ -48,6 +48,8 @@ JourneyQueryPage {
                 lineModes.push(Line.Bus, Line.Coach);
             if (ferryModeAction.checked)
                 lineModes.push(Line.Ferry, Line.Boat);
+            if (rideshareModeAction.checked)
+                lineModes.push(Line.RideShare)
             if (aircraftModeAction.checked)
                 lineModes.push(Line.Air)
         }
@@ -102,6 +104,14 @@ JourneyQueryPage {
             checked: true
             onTriggered: root.updateRequest()
         },
+        Kirigami.Action {
+            id: rideshareModeAction
+            text: i18nc("journey query search constraint, title", "Ride sharing")
+            icon.source: LineMode.iconName(Line.RideShare)
+            checkable: true
+            checked: false
+            onTriggered: root.updateRequest()
+        },
         Kirigami.Action {
             id: aircraftModeAction
             text: i18nc("journey query search constraint, title", "Airplane")
diff --git a/src/app/DepartureQueryPage.qml b/src/app/DepartureQueryPage.qml
index 8e323a920..b06ca8f5c 100644
--- a/src/app/DepartureQueryPage.qml
+++ b/src/app/DepartureQueryPage.qml
@@ -63,6 +63,14 @@ Kirigami.ScrollablePage {
             checkable: true
             checked: true
         },
+        Kirigami.Action {
+            id: rideshareModeAction
+            text: i18nc("journey query search constraint, title", "Ride sharing")
+            icon.source: LineMode.iconName(Line.RideShare)
+            displayHint: Kirigami.DisplayHint.AlwaysHide
+            checkable: true
+            checked: true
+        },
         Kirigami.Action {
             id: aircraftModeAction
             text: i18nc("journey query search constraint, title", "Airplane")
@@ -100,6 +108,8 @@ Kirigami.ScrollablePage {
                 lineModes.push(Line.Bus, Line.Coach);
             if (ferryModeAction.checked)
                 lineModes.push(Line.Ferry, Line.Boat);
+            if (rideshareModeAction.checked)
+                lineModes.push(Line.RideShare);
             if (aircraftModeAction.checked)
                 lineModes.push(Line.Air);
         }
diff --git a/src/app/JourneyFilterPage.qml b/src/app/JourneyFilterPage.qml
index 2de66e610..d2c4de7e4 100644
--- a/src/app/JourneyFilterPage.qml
+++ b/src/app/JourneyFilterPage.qml
@@ -21,6 +21,7 @@ FormCard.FormCardPage {
     readonly property var rapidTransitModes: [Line.RapidTransit, Line.Metro, Line.Tramway, Line.RailShuttle, Line.Funicular, Line.AerialLift]
     readonly property var busModes: [Line.Bus, Line.Coach]
     readonly property var ferryModes: [Line.Ferry, Line.Boat]
+    readonly property var rideshareModes: [Line.RideShare]
     readonly property var aircraftModes: [Line.Air]
 
     readonly property var lineModes: {
@@ -36,6 +37,8 @@ FormCard.FormCardPage {
                 modes.push(...root.busModes);
             if (ferrySwitch.checked)
                 modes.push(...root.ferryModes);
+            if (rideshareSwitch.checked)
+                modes.push(...root.rideshareModes);
             if (aircraftSwitch.checked)
                 modes.push(...root.aircraftModes);
         }
@@ -114,6 +117,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: root.checkLineModes(root.rideshareModes)
+            leading: Kirigami.Icon {
+                source: LineMode.iconName(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.