Commit 2cf57e5b authored by Nicolas Fella's avatar Nicolas Fella

Take stuff by reference

parent 903812de
......@@ -37,7 +37,7 @@ Controller::Controller(QObject *parent)
m_departureTime = QTime::currentTime();
}
void Controller::setStart(const KPublicTransport::Location start)
void Controller::setStart(const KPublicTransport::Location &start)
{
m_start = start;
Q_EMIT startChanged();
......@@ -48,7 +48,7 @@ KPublicTransport::Location Controller::start() const
return m_start;
}
void Controller::setDestination(const KPublicTransport::Location destination)
void Controller::setDestination(const KPublicTransport::Location &destination)
{
m_destination = destination;
Q_EMIT destinationChanged();
......@@ -98,7 +98,7 @@ void Controller::setDepartureTime(const QTime &time)
}
}
KPublicTransport::LocationRequest Controller::createLocationRequest(const QString name)
KPublicTransport::LocationRequest Controller::createLocationRequest(const QString &name)
{
KPublicTransport::LocationRequest req;
req.setName(name);
......@@ -115,7 +115,7 @@ KPublicTransport::StopoverRequest Controller::createStopoverRequest()
return req;
}
void Controller::showOnMap(KPublicTransport::Location location)
void Controller::showOnMap(KPublicTransport::Location &location)
{
QUrl url;
url.setScheme(QStringLiteral("https"));
......
......@@ -42,10 +42,10 @@ public:
explicit Controller(QObject *parent = nullptr);
KPublicTransport::Location start() const;
void setStart(const KPublicTransport::Location start);
void setStart(const KPublicTransport::Location &start);
KPublicTransport::Location destination() const;
void setDestination(const KPublicTransport::Location destination);
void setDestination(const KPublicTransport::Location &destination);
QDate departureDate() const;
void setDepartureDate(const QDate &date);
......@@ -54,10 +54,10 @@ public:
void setDepartureTime(const QTime &time);
Q_INVOKABLE KPublicTransport::JourneyRequest createJourneyRequest();
Q_INVOKABLE KPublicTransport::LocationRequest createLocationRequest(const QString name);
Q_INVOKABLE KPublicTransport::LocationRequest createLocationRequest(const QString &name);
Q_INVOKABLE KPublicTransport::StopoverRequest createStopoverRequest();
Q_INVOKABLE void showOnMap(KPublicTransport::Location location);
Q_INVOKABLE void showOnMap(KPublicTransport::Location &location);
Q_SIGNALS:
void startChanged();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment