[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    [publictransport] /: Less source name ambiguities, fix sources without provider ID
From:       Friedrich_Karl_Tilman_Pülz <fpuelz () gmx ! de>
Date:       2012-11-30 20:36:57
Message-ID: 20121130203657.3183BA6091 () git ! kde ! org
[Download RAW message or body]

Git commit 6da4a9e8ad1b065f676a6a6ae257c3dac6a519d1 by Friedrich Karl Tilman Pülz.
Committed on 26/11/2012 at 17:56.
Pushed by fkpulz into branch 'master'.

Less source name ambiguities, fix sources without provider ID

Case insensitive matching can produce unnecessarey ambiguities,
ie. multiple source names for the same source. Data gets duplicated
and to update data sources all connected source name variants need
to be updated (or they will not receive any updates).
Use case sensitive source names to solve these problems. Parameter
names need to be completely lower case now. Engine users have been
updated. To disambiguate a source name it's parameters now get reordered
to a standard order, this makes source names with only different parameter
order point to the same data. The ID of the default provider for the
users country gets now directly inserted if it is missing from a source
name (fixes the runner).

M  +1    -1    applet-flights/flights.cpp
M  +2    -2    applet-graphicaltimetableline/graphicaltimetableline.cpp
M  +4    -4    applet/publictransport_p.cpp
M  +106  -22   engine/publictransportdataengine.cpp
M  +32   -15   engine/publictransportdataengine.h
M  +2    -2    runner/publictransportrunner.cpp

http://commits.kde.org/publictransport/6da4a9e8ad1b065f676a6a6ae257c3dac6a519d1

diff --git a/applet-flights/flights.cpp b/applet-flights/flights.cpp
index 81a6aab..1e5325e 100644
--- a/applet-flights/flights.cpp
+++ b/applet-flights/flights.cpp
@@ -71,7 +71,7 @@ void Flights::init()
     setConfigurationRequired( m_airport.isEmpty(), i18n("Please select an airport") \
);  if ( !m_airport.isEmpty() ) {
         dataEngine("publictransport")->connectSource(
-                QString("Departures \
international_flightstats|stop=%1|timeOffset=0").arg(m_airport), this, +              \
QString("Departures international_flightstats|stop=%1|timeoffset=0").arg(m_airport), \
this,  60000, Plasma::AlignToMinute );
     }
 }
diff --git a/applet-graphicaltimetableline/graphicaltimetableline.cpp \
b/applet-graphicaltimetableline/graphicaltimetableline.cpp index 99b719e..eeca62a \
                100644
--- a/applet-graphicaltimetableline/graphicaltimetableline.cpp
+++ b/applet-graphicaltimetableline/graphicaltimetableline.cpp
@@ -168,7 +168,7 @@ void GraphicalTimetableLine::init()
     }
 
     if ( !configurationRequired() ) {
-        m_sourceName = QString("Departures %1|stop=%2|timeOffset=0")
+        m_sourceName = QString("Departures %1|stop=%2|timeoffset=0")
                     .arg(m_stopSettings.get<QString>(ServiceProviderSetting))
                     .arg(m_stopSettings.stop(0).nameOrId());
         dataEngine("publictransport")->connectSource( m_sourceName,
@@ -234,7 +234,7 @@ void GraphicalTimetableLine::configAccepted()
 
     if ( !configurationRequired() ) {
         m_animate = false;
-        m_sourceName = QString("Departures %1|stop=%2|timeOffset=0")
+        m_sourceName = QString("Departures %1|stop=%2|timeoffset=0")
                     .arg(m_stopSettings.get<QString>(ServiceProviderSetting))
                     \
.arg(m_stopSettings.stops(StopSettings::UseStopIdIfAvailable).first());  \
                dataEngine("publictransport")->connectSource( m_sourceName,
diff --git a/applet/publictransport_p.cpp b/applet/publictransport_p.cpp
index ff1d6e4..b95f306 100644
--- a/applet/publictransport_p.cpp
+++ b/applet/publictransport_p.cpp
@@ -898,13 +898,13 @@ void PublicTransportAppletPrivate::reconnectSource()
     stopIndexToSourceName.clear();
     for( int i = 0; i < stops.count(); ++i ) {
         QString stopValue = stopIDs[i].isEmpty() ? stops[i] : stopIDs[i];
-        QString currentSource = QString( "%4 %1|stop=%2|maxCount=%3" )
+        QString currentSource = QString( "%4 %1|stop=%2|maxcount=%3" )
                 .arg( providerId ).arg( stopValue ).arg( \
                settings.maximalNumberOfDepartures() )
                 .arg( settings.departureArrivalListType() == ArrivalList
                         ? "Arrivals" : "Departures" );
         switch ( firstDepartureMode ) {
         case RelativeToCurrentTime:
-            currentSource += QString( "|timeOffset=%1" ).arg(
+            currentSource += QString( "|timeoffset=%1" ).arg(
                                  \
stopSettings.get<int>(TimeOffsetOfFirstDepartureSetting) );  break;
         case AtCustomTime:
@@ -994,8 +994,8 @@ void PublicTransportAppletPrivate::reconnectJourneySource( const \
                QString &target
                                .arg( _targetStopName );
     } else {
         currentJourneySource = QString( stopIsTarget
-                                        ? "%5 \
                %1|originStop=%2|targetStop=%3|datetime=%4"
-                                        : "%5 \
%1|originStop=%3|targetStop=%2|datetime=%4" ) +                                       \
? "%5 %1|originstop=%2|targetstop=%3|datetime=%4" +                                   \
                : "%5 %1|originstop=%3|targetstop=%2|datetime=%4" )
                                .arg( \
                settings.currentStop().get<QString>(ServiceProviderSetting) )
                                .arg( settings.currentStop().stop(0).nameOrId() )
                                .arg( _targetStopName )
diff --git a/engine/publictransportdataengine.cpp \
b/engine/publictransportdataengine.cpp index 9923ec9..63b6e8b 100644
--- a/engine/publictransportdataengine.cpp
+++ b/engine/publictransportdataengine.cpp
@@ -334,7 +334,7 @@ void PublicTransportEngine::slotSourceRemoved( const QString \
&sourceName )  
         // If a provider was used by the source, remove the provider if it is not \
used in another source  if ( dataSource->data().contains("serviceProvider") ) {
-            const QString providerId = \
dataSource->value("serviceProvider").toString().toLower(); +            const QString \
providerId = dataSource->value("serviceProvider").toString();  if ( \
!providerId.isEmpty() && !isProviderUsed(providerId) ) {  m_providers.remove( \
providerId );  }
@@ -907,7 +907,7 @@ QString PublicTransportEngine::providerIdFromSourceName( const \
QString &sourceNa  }
 
     const int endPos = sourceName.indexOf( '|', pos + 1 );
-    return sourceName.mid( pos + 1, endPos - pos - 1 ).trimmed();
+    return fixProviderId( sourceName.mid(pos + 1, endPos - pos - 1).trimmed() );
 }
 
 ParseDocumentMode PublicTransportEngine::parseModeFromSourceType(
@@ -1059,16 +1059,37 @@ void PublicTransportEngine::forceUpdate()
     forceImmediateUpdateOfAllVisualizations();
 }
 
-QString PublicTransportEngine::disambiguateSourceName( const QString &sourceName )
+QString PublicTransportEngine::fixProviderId( const QString &providerId )
 {
-    QString ret = sourceName.toLower();
+    if ( !providerId.isEmpty() ) {
+        return providerId;
+    }
+
+    // No service provider ID given, use the default one for the users country
+    const QString country = KGlobal::locale()->country();
+
+    // Try to find the XML filename of the default accessor for [country]
+    const QString filePath = ServiceProviderGlobal::defaultProviderForLocation( \
country ); +    if ( filePath.isEmpty() ) {
+        return 0;
+    }
+
+    // Extract service provider ID from filename
+    const QString defaultProviderId = ServiceProviderGlobal::idFromFileName( \
filePath ); +    kDebug() << "No service provider ID given, using the default one for \
country" +             << country << "which is" << defaultProviderId;
+    return defaultProviderId;
+}
 
-    // Remove maxCount argument
-    ret.remove( QRegExp("(maxCount=[^\\|]+)") );
+QString PublicTransportEngine::disambiguateSourceName( const QString &sourceName )
+{
+    // Remove maxcount argument
+    QString ret = sourceName;
+    ret.remove( QRegExp("(maxcount=[^\\|]+)") );
 
     // Round time parameter values to 15 minutes precision
     QRegExp rx( "(time=[^\\|]+|datetime=[^\\|]+)" );
-    if ( rx.indexIn(ret) != -1 ) {
+    if ( rx.indexIn( ret ) != -1 ) {
         // Get the time value
         const QString timeParameter = rx.cap( 1 );
         QDateTime time;
@@ -1086,6 +1107,63 @@ QString PublicTransportEngine::disambiguateSourceName( const \
QString &sourceName  // Replace old time parameter with a new one
         ret.replace( rx.pos(), rx.matchedLength(), QLatin1String("datetime=") + \
time.toString() );  }
+
+    // Read parameters to reorder them afterwards
+    const SourceType type = sourceTypeFromName( ret );
+    const QString typeKeyword = sourceTypeKeyword( type );
+    const QStringList parameterPairs = ret.mid( typeKeyword.length() )
+            .trimmed().split( '|', QString::SkipEmptyParts );
+    QString defaultParameter;
+    QHash< QString, QString > parameters;
+    for ( int i = 0; i < parameterPairs.length(); ++i ) {
+        const QString parameter = parameterPairs.at( i ).trimmed();
+        const int pos = parameter.indexOf( '=' );
+        if ( pos == -1 ) {
+            // No parameter name given, this is the default parameter, eg. the \
provider ID +            defaultParameter = fixProviderId( parameter );
+        } else {
+            // Only add parameters with non-empty parameter name and value,
+            // make parameter value lower case (eg. stop names)
+            const QString parameterName = parameter.left( pos );
+            const QString parameterValue = parameter.mid( pos + 1 ).trimmed();
+            if ( !parameterName.isEmpty() && !parameterValue.isEmpty() ) {
+                parameters[ parameterName ] = parameterValue.toLower();
+            }
+        }
+    }
+
+    // Build non-ambiguous source name with standardized parameter order
+    ret = typeKeyword + ' ' + defaultParameter;
+    if ( parameters.contains(QLatin1String("city")) ) {
+        ret += "|city=" + parameters["city"];
+    }
+    if ( parameters.contains(QLatin1String("stop")) ) {
+        ret += "|stop=" + parameters["stop"];
+    }
+    if ( parameters.contains(QLatin1String("originstop")) ) {
+        ret += "|originstop=" + parameters["originstop"];
+    }
+    if ( parameters.contains(QLatin1String("targetstop")) ) {
+        ret += "|targetstop=" + parameters["targetstop"];
+    }
+    if ( parameters.contains(QLatin1String("timeoffset")) ) {
+        ret += "|timeoffset=" + parameters["timeoffset"];
+    }
+    if ( parameters.contains(QLatin1String("time")) ) {
+        ret += "|time=" + parameters["time"];
+    }
+    if ( parameters.contains(QLatin1String("datetime")) ) {
+        ret += "|datetime=" + parameters["datetime"];
+    }
+    if ( parameters.contains(QLatin1String("maxcount")) ) {
+        ret += "|maxcount=" + parameters["maxcount"];
+    }
+    if ( parameters.contains(QLatin1String("longitude")) ) {
+        ret += "|longitude=" + parameters["longitude"];
+    }
+    if ( parameters.contains(QLatin1String("latitude")) ) {
+        ret += "|latitude=" + parameters["latitude"];
+    }
     return ret;
 }
 
@@ -1196,28 +1274,29 @@ const QLatin1String PublicTransportEngine::sourceTypeKeyword( \
SourceType sourceT  PublicTransportEngine::SourceType \
PublicTransportEngine::sourceTypeFromName(  const QString &sourceName )
 {
-    if ( sourceName.startsWith(sourceTypeKeyword(ServiceProviderSource) + ' ', \
Qt::CaseInsensitive) ) { +    // Get type of the source, do not match case \
insensitive, otherwise there can be multiple +    // sources with the same data but \
only different case +    if ( \
sourceName.startsWith(sourceTypeKeyword(ServiceProviderSource) + ' ') ) {  return \
                ServiceProviderSource;
-    } else if ( sourceName.compare(sourceTypeKeyword(ServiceProvidersSource), \
Qt::CaseInsensitive) == 0 ) { +    } else if ( \
sourceName.compare(sourceTypeKeyword(ServiceProvidersSource)) == 0 ) {  return \
                ServiceProvidersSource;
-    } else if ( sourceName.compare(sourceTypeKeyword(ErroneousServiceProvidersSource),
                
-                                   Qt::CaseInsensitive) == 0 ) {
+    } else if ( sourceName.compare(sourceTypeKeyword(ErroneousServiceProvidersSource)) \
== 0 ) {  return ErroneousServiceProvidersSource;
-    } else if ( sourceName.compare(sourceTypeKeyword(LocationsSource), \
Qt::CaseInsensitive) == 0 ) { +    } else if ( \
sourceName.compare(sourceTypeKeyword(LocationsSource)) == 0 ) {  return \
                LocationsSource;
-    } else if ( sourceName.compare(sourceTypeKeyword(VehicleTypesSource), \
Qt::CaseInsensitive) == 0 ) { +    } else if ( \
sourceName.compare(sourceTypeKeyword(VehicleTypesSource)) == 0 ) {  return \
                VehicleTypesSource;
-    } else if ( sourceName.startsWith(sourceTypeKeyword(DeparturesSource), \
Qt::CaseInsensitive) ) { +    } else if ( \
sourceName.startsWith(sourceTypeKeyword(DeparturesSource)) ) {  return \
                DeparturesSource;
-    } else if ( sourceName.startsWith(sourceTypeKeyword(ArrivalsSource), \
Qt::CaseInsensitive) ) { +    } else if ( \
sourceName.startsWith(sourceTypeKeyword(ArrivalsSource)) ) {  return ArrivalsSource;
-    } else if ( sourceName.startsWith(sourceTypeKeyword(StopsSource), \
Qt::CaseInsensitive) ) { +    } else if ( \
sourceName.startsWith(sourceTypeKeyword(StopsSource)) ) {  return StopsSource;
-    } else if ( sourceName.startsWith(sourceTypeKeyword(JourneysDepSource), \
Qt::CaseInsensitive) ) { +    } else if ( \
sourceName.startsWith(sourceTypeKeyword(JourneysDepSource)) ) {  return \
                JourneysDepSource;
-    } else if ( sourceName.startsWith(sourceTypeKeyword(JourneysArrSource), \
Qt::CaseInsensitive) ) { +    } else if ( \
sourceName.startsWith(sourceTypeKeyword(JourneysArrSource)) ) {  return \
                JourneysArrSource;
-    } else if ( sourceName.startsWith(sourceTypeKeyword(JourneysSource), \
Qt::CaseInsensitive) ) { +    } else if ( \
sourceName.startsWith(sourceTypeKeyword(JourneysSource)) ) {  return JourneysSource;
     } else {
         return InvalidSourceName;
@@ -1245,7 +1324,7 @@ PublicTransportEngine::SourceRequestData::SourceRequestData( \
const QString &name  bool hasLongitude = false, hasLatitude = false;
             for ( int i = 0; i < parameters.length(); ++i ) {
                 const QString parameter = parameters.at( i ).trimmed();
-                const QString parameterName = parameter.left( parameter.indexOf('=') \
).toLower(); +                const QString parameterName = parameter.left( \
parameter.indexOf('=') );  if ( parameterName == QLatin1String("longitude") ) {
                     hasLongitude = true;
                 } else if ( parameterName == QLatin1String("latitude") ) {
@@ -1281,7 +1360,7 @@ PublicTransportEngine::SourceRequestData::SourceRequestData( \
                const QString &name
                 // No parameter name given, assume the service provider ID
                 defaultParameter = parameter;
             } else {
-                const QString parameterName = parameter.left( pos ).toLower();
+                const QString parameterName = parameter.left( pos );
                 const QString parameterValue = parameter.mid( pos + 1 ).trimmed();
                 if ( parameterValue.isEmpty() ) {
                     kWarning() << "Empty parameter value for parameter" << \
parameterName; @@ -1363,6 +1442,10 @@ \
PublicTransportEngine::SourceRequestData::SourceRequestData( const QString &name  \
journeyRequest->setTargetStop( journeyRequest->stop() );  }
         }
+
+        // The default parameter is the provider ID for data requesting sources,
+        // use the default provider for the users country if no ID is given
+        defaultParameter = PublicTransportEngine::fixProviderId( defaultParameter );
     } else {
         // Extract provider ID or country code, which follow after the source type \
                keyword in name
         defaultParameter = name.mid( QString(sourceTypeKeyword(type)).length() \
).trimmed(); @@ -1933,7 +2016,8 @@ bool PublicTransportEngine::requestMoreItems( \
const QString &sourceName,  }
 
     const SourceRequestData data( sourceName );
-    const ProviderPointer provider = providerFromId(  data.defaultParameter );
+    kDebug() << data.defaultParameter;
+    const ProviderPointer provider = providerFromId( data.defaultParameter );
     if ( provider.isNull() ) {
         // Service provider couldn't be created, should only happen after provider \
                updates,
         // where the provider worked to get timetable items, but the new provider \
                version
diff --git a/engine/publictransportdataengine.h b/engine/publictransportdataengine.h
index 23e5475..9d9eb4b 100644
--- a/engine/publictransportdataengine.h
+++ b/engine/publictransportdataengine.h
@@ -139,13 +139,18 @@ public:
     /** @brief Get ParseDocumentMode associated with the given @p sourceType. */
     static ParseDocumentMode parseModeFromSourceType( SourceType sourceType );
 
-    /** @brief Get the SourceType associated with the given @p sourceName. */
+    /**
+     * @brief Get the SourceType associated with the given @p sourceName.
+     * This matches case sensitive, otherwise there can be multiple data sources \
with the +     * same data but only different case in their names.
+     **/
     static SourceType sourceTypeFromName( const QString &sourceName );
 
     /** @brief Whether or not data sources of @p sourceType request data from a \
server. */  static bool isDataRequestingSourceType( SourceType sourceType ) {
         return static_cast< int >( sourceType ) >= 10; };
 
+    /** @brief Get the ID of the provider used for the source with the given @p \
sourceName. */  static QString providerIdFromSourceName( const QString &sourceName );
 
     /** @brief Reimplemented to add some always visible default sources. */
@@ -225,7 +230,7 @@ public:
      * @brief The default time offset from now for the first \
                departure/arrival/journey in results.
      *
      * This is used if no time was specified in the source name with the parameter \
                @c time,
-     * @c dateTime or @c timeOffset.
+     * @c datetime or @c timeoffset.
      **/
     static const int DEFAULT_TIME_OFFSET;
 
@@ -626,6 +631,9 @@ private:
      **/
     static QString disambiguateSourceName( const QString &sourceName );
 
+    /** @brief If @p providerId is empty return the default provider for the users \
country. */ +    static QString fixProviderId( const QString &providerId );
+
     inline static uint hashForDeparture( const QVariantHash &departure ) {
         return hashForDeparture( \
                departure[Enums::toString(Enums::DepartureDateTime)].toDateTime(),
                 static_cast<Enums::VehicleType>(departure[Enums::toString(Enums::TypeOfVehicle)].toInt()),
 @@ -757,6 +765,13 @@ stop suggestions (@ref usage_stopList_sec).<br />
 The engine provides services for all timetable data sources (departures, journeys, \
...). It offers  operations to manually request updates, request earlier/later \
timetable items or to request  additional data for specific timetable items (@ref \
usage_service_sec).<br /> +@note Since version 0.11 the engine will only match data \
source names with correct case, ie. +"serviceproViders" will not work any longer, but \
"ServiceProviders" will. All parameter names in +data source names need to be \
completely lower case. This is to prevent ambiguities, each variant +would get it's \
own data source object in the data engine, duplicating the data. To update a data \
+source all connected source name variants would need to be updated. Only accepting \
source names +case sensitive makes it much easier for the engine. The only thing left \
that can make two identic +data sources ambiguous is their parameter order, which \
gets handled using disambiguateSourceName().  <br />
 The following enumeration can be used in your applet if you don't want to use
 libpublictransporthelper which exports this enumaration as @ref \
PublicTransport::VehicleType. @@ -937,12 +952,13 @@ provider has useSeparateCityValue \
set to @c true (see @ref usage_serviceprovider  parameter <i>city</i> is also needed \
(otherwise it is ignored).  You can leave the service provider ID away, the data \
engine then uses the default service provider  for the users country.<br />
+@note All parameter names need to be completely lower case.
 The following parameters are allowed:<br />
 <table>
 <tr><td><i>stop</i></td> <td>The name or ID of the stop to get departures/arrivals \
for.</td></tr>  <tr><td><i>city</i></td> <td>The city to get departures/arrivals for, \
                if needed.</td></tr>
-<tr><td><i>maxCount</i></td> <td>The maximum departure/arrival count to \
                get.</td></tr>
-<tr><td><i>timeOffset</i></td> <td>The offset in minutes from now for the first \
departure / +<tr><td><i>maxcount</i></td> <td>The maximum departure/arrival count to \
get.</td></tr> +<tr><td><i>timeoffset</i></td> <td>The offset in minutes from now for \
the first departure /  arrival to get.</td></tr>
 <tr><td><i>time</i></td> <td>The time of the first departure/arrival to get \
("hh:mm"). This uses  the current date. To use another date use 'datetime'.</td></tr>
@@ -955,7 +971,7 @@ QDateTime::toString()).</td></tr>
 <b>"Departures de_db|stop=Pappelstraße, Bremen"</b><br />
 Gets departures for the stop "Pappelstraße, Bremen" using the service provider \
db.de.<br /><br />  
-<b>"Arrivals de_db|stop=Leipzig|timeOffset=5|maxCount=99"</b><br />
+<b>"Arrivals de_db|stop=Leipzig|timeoffset=5|maxcount=99"</b><br />
 Gets arrivals for the stop "Leipzig" using db.de, the first possible arrival is in \
five minutes  from now, the maximum arrival count is 99.<br /><br />
 
@@ -963,7 +979,7 @@ from now, the maximum arrival count is 99.<br /><br />
 Gets departures for the stop "Frankfurt (Main) Speyerer Straße" using rmv.de, the \
first possible  departure is at eight o'clock.<br /><br />
 
-<b>"Departures de_rmv|stop=3000019|maxCount=20|timeOffset=1"</b><br />
+<b>"Departures de_rmv|stop=3000019|maxcount=20|timeoffset=1"</b><br />
 Gets departures for the stop with the ID "3000019", the first possible departure is \
in one minute  from now, the maximum departure count is 20.<br /><br />
 
@@ -1081,17 +1097,18 @@ source (much like the data source for departures / arrivals). \
The data source na  "Journeys". Next comes a space (" "), then the ID of the service \
provider to use, e.g. "de_db"  for db.de, a service provider for germany ("Deutsche \
Bahn").  The following parameters are separated by "|" and start with the parameter \
                name followed by "=".
-The sorting of the additional parameters doesn't matter. The parameters \
                <i>originStop</i> and
-<i>targetStop</i> are needed and can be the stop names or the stop IDs. If the \
service provider +The sorting of the additional parameters doesn't matter. The \
parameters <i>originstop</i> and +<i>targetstop</i> are needed and can be the stop \
names or the stop IDs. If the service provider  has useSeparateCityValue set to @c \
true (see @ref usage_serviceproviders_sec), the parameter  <i>city</i> is also needed \
(otherwise it is ignored).<br /> +@note All parameter names need to be completely \
lower case.  The following parameters are allowed:<br />
 <table>
-<tr><td><i>originStop</i></td> <td>The name or ID of the origin stop.</td></tr>
-<tr><td><i>targetStop</i></td> <td>The name or ID of the target stop.</td></tr>
+<tr><td><i>originstop</i></td> <td>The name or ID of the origin stop.</td></tr>
+<tr><td><i>targetstop</i></td> <td>The name or ID of the target stop.</td></tr>
 <tr><td><i>city</i></td> <td>The city to get journeys for, if needed.</td></tr>
-<tr><td><i>maxCount</i></td> <td>The maximum journey count to get.</td></tr>
-<tr><td><i>timeOffset</i></td>
+<tr><td><i>maxcount</i></td> <td>The maximum journey count to get.</td></tr>
+<tr><td><i>timeoffset</i></td>
 <td>The offset in minutes from now for the first journey to get.</td></tr>
 <tr><td><i>time</i></td> <td>The time for the first journey to get (in format \
"hh:mm").</td></tr>  <tr><td><i>datetime</i></td> <td>The date and time for the first \
journey to get @@ -1100,11 +1117,11 @@ The following parameters are allowed:<br />
 <br />
 
 <b>Examples:</b><br />
-<b>"Journeys de_db|originStop=Pappelstraße, Bremen|targetStop=Kirchweg, \
Bremen"</b><br /> +<b>"Journeys de_db|originstop=Pappelstraße, \
Bremen|targetstop=Kirchweg, Bremen"</b><br />  Gets journeys from stop \
"Pappelstraße, Bremen" to stop "Kirchweg, Bremen"  using the service provider \
db.de.<br /><br />  
-<b>"Journeys de_db|originStop=Leipzig|targetStop=Hannover|timeOffset=5|maxCount=99"</b><br \
/> +<b>"Journeys de_db|originstop=Leipzig|targetstop=Hannover|timeoffset=5|maxCount=99"</b><br \
/>  Gets journeys from stop "Leipzig" to stop "Hannover" using db.de, the first
 possible journey departs in five minutes from now, the maximum journey count is \
99.<br /><br />  
@@ -1115,7 +1132,7 @@ class Applet : public Plasma::Applet {
 public:
     Applet(QObject *parent, const QVariantList &args) : AppletWithState(parent, \
args) {  dataEngine("publictransport")->connectSource(
-                "Journeys de_db|originStop=Pappelstraße, \
Bremen|targetStop=Kirchweg, Bremen", +                "Journeys \
de_db|originstop=Pappelstraße, Bremen|targetstop=Kirchweg, Bremen",  this, 60 * 1000 \
);  };
 
diff --git a/runner/publictransportrunner.cpp b/runner/publictransportrunner.cpp
index bc008bf..2f12b9d 100644
--- a/runner/publictransportrunner.cpp
+++ b/runner/publictransportrunner.cpp
@@ -383,7 +383,7 @@ void AsyncDataEngineUpdater::query( Plasma::DataEngine *engine,
             return;
         }
 
-        m_sourceName = QString( "Journeys \
%1|originStop=%2|targetStop=%3|maxCount=%4|datetime=%5" ) +        m_sourceName = \
                QString( "Journeys \
                %1|originstop=%2|targetstop=%3|maxcount=%4|datetime=%5" )
                        .arg( m_settings.serviceProviderID ).arg( stop ).arg( stop2 )
                        .arg( resultCount )
                        .arg( QDateTime::currentDateTime()
@@ -401,7 +401,7 @@ void AsyncDataEngineUpdater::query( Plasma::DataEngine *engine,
             type = "Departures";
         }
 
-        m_sourceName = QString( "%1 %2|stop=%3|maxCount=%4|timeoffset=%5" )
+        m_sourceName = QString( "%1 %2|stop=%3|maxcount=%4|timeoffset=%5" )
                        .arg( type ).arg( m_settings.serviceProviderID ).arg( stop )
                        .arg( resultCount ).arg( data.minutesUntilFirstResult );
     }


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic