Commit 037b083a authored by Volker Krause's avatar Volker Krause
Browse files

Switch to KDECompilerSettings from ECM 5.85

parent 6b60e60b
......@@ -10,10 +10,10 @@ set (RELEASE_SERVICE_VERSION_MICRO "70")
set (RELEASE_SERVICE_VERSION "${RELEASE_SERVICE_VERSION_MAJOR}.${RELEASE_SERVICE_VERSION_MINOR}.${RELEASE_SERVICE_VERSION_MICRO}")
project(KPublicTransport VERSION ${RELEASE_SERVICE_VERSION})
find_package(ECM 5.59 REQUIRED NO_MODULE)
find_package(ECM 5.85 REQUIRED NO_MODULE)
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake ${ECM_MODULE_PATH} ${ECM_KDE_MODULE_DIR})
include(KDEFrameworkCompilerSettings NO_POLICY_SCOPE)
include(KDECompilerSettings NO_POLICY_SCOPE)
include(ECMAddTests)
include(ECMGenerateHeaders)
include(ECMQtDeclareLoggingCategory)
......@@ -27,10 +27,6 @@ include(ECMAddQch)
option(BUILD_QCH "Build API documentation in QCH format (for e.g. Qt Assistant, Qt Creator & KDevelop)" OFF)
add_feature_info(QCH ${BUILD_QCH} "API documentation in QCH format (for e.g. Qt Assistant, Qt Creator & KDevelop)")
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
ecm_setup_version(PROJECT VARIABLE_PREFIX KPUBLICTRANSPORT
VERSION_HEADER kpublictransport_version.h
PACKAGE_VERSION_FILE "${CMAKE_CURRENT_BINARY_DIR}/KPublicTransportConfigVersion.cmake"
......@@ -58,7 +54,6 @@ endif()
add_definitions(-DQT_DISABLE_DEPRECATED_BEFORE=0x050f00)
add_definitions(-DKF_DISABLE_DEPRECATED_BEFORE_AND_AT=0x055100)
add_definitions(-DQT_NO_FOREACH)
add_subdirectory(src)
if (BUILD_TESTING)
......
......@@ -108,7 +108,7 @@ ecm_qt_declare_logging_category(KPublicTransport HEADER logging.h IDENTIFIER KPu
generate_export_header(KPublicTransport BASE_NAME KPublicTransport)
set_target_properties(KPublicTransport PROPERTIES
VERSION ${KPUBLICTRANSPORT_VERSION_STRING}
VERSION ${KPUBLICTRANSPORT_VERSION}
SOVERSION ${KPUBLICTRANSPORT_SOVERSION}
EXPORT_NAME KPublicTransport
)
......
......@@ -90,7 +90,7 @@ bool AssetRepository::isQueueEmpty()
void AssetRepository::downloadNext()
{
if (m_queue.empty()) {
emit downloadFinished();
Q_EMIT downloadFinished();
return;
}
......
......@@ -69,7 +69,7 @@ void GBFSJob::discoverFinished(QNetworkReply *reply)
if (reply->error() != QNetworkReply::NoError) {
m_error = NetworkError;
m_errorMsg = reply->errorString();
emit finished();
Q_EMIT finished();
return;
}
......@@ -112,7 +112,7 @@ void GBFSJob::parseDiscoverData(bool sysInfoOnly)
if (feeds.empty()) {
m_error = DataError;
m_errorMsg = QStringLiteral("no feed found in discovery response!");
emit finished();
Q_EMIT finished();
return;
}
......@@ -168,7 +168,7 @@ void GBFSJob::systemInformationFinished(QNetworkReply *reply)
if (reply->error() != QNetworkReply::NoError) {
m_error = NetworkError;
m_errorMsg = reply->errorString();
emit finished();
Q_EMIT finished();
return;
}
......@@ -179,7 +179,7 @@ void GBFSJob::systemInformationFinished(QNetworkReply *reply)
if (systemId.isEmpty()) {
m_error = DataError;
m_errorMsg = QStringLiteral("unable to determine system_id!");
emit finished();
Q_EMIT finished();
return;
}
m_service.systemId = systemId;
......@@ -199,7 +199,7 @@ void GBFSJob::fetchFinished(QNetworkReply *reply, GBFS::FileType type)
m_error = NetworkError;
m_errorMsg = reply->errorString();
if (m_pendingJobs == 0) { // wait for the rest to finish otherwise, to avoid double finished() emission
emit finished();
Q_EMIT finished();
}
return;
}
......@@ -325,5 +325,5 @@ void GBFSJob::finalize()
m_service.boundingBox = QRectF(QPointF(m_minLon, m_minLat), QPointF(m_maxLon, m_maxLat));
}
GBFSServiceRepository::store(m_service);
emit finished();
Q_EMIT finished();
}
......@@ -490,7 +490,7 @@ void Manager::setAllowInsecureBackends(bool insecure)
return;
}
d->m_allowInsecure = insecure;
emit configurationChanged();
Q_EMIT configurationChanged();
}
JourneyReply* Manager::queryJourney(const JourneyRequest &req) const
......@@ -802,7 +802,7 @@ void Manager::setBackendEnabled(const QString &backendId, bool enabled)
sortedRemove(d->m_enabledBackends, backendId);
sortedInsert(d->m_disabledBackends, backendId);
}
emit configurationChanged();
Q_EMIT configurationChanged();
}
QStringList Manager::enabledBackends() const
......@@ -840,5 +840,5 @@ void KPublicTransport::Manager::setBackendsEnabledByDefault(bool byDefault)
{
d->m_backendsEnabledByDefault = byDefault;
emit configurationChanged();
Q_EMIT configurationChanged();
}
......@@ -26,7 +26,7 @@ void AbstractQueryModelPrivate::setLoading(bool l)
return;
}
m_loading = l;
emit q_ptr->loadingChanged();
Q_EMIT q_ptr->loadingChanged();
}
void AbstractQueryModelPrivate::setErrorMessage(const QString &msg)
......@@ -35,7 +35,7 @@ void AbstractQueryModelPrivate::setErrorMessage(const QString &msg)
return;
}
m_errorMessage = msg;
emit q_ptr->errorMessageChanged();
Q_EMIT q_ptr->errorMessageChanged();
}
void AbstractQueryModelPrivate::monitorReply(Reply *reply)
......@@ -47,7 +47,7 @@ void AbstractQueryModelPrivate::monitorReply(Reply *reply)
m_reply = nullptr;
if (reply->error() == KPublicTransport::Reply::NoError) {
AttributionUtil::merge(m_attributions, std::move(reply->takeAttributions()));
emit q_ptr->attributionsChanged();
Q_EMIT q_ptr->attributionsChanged();
} else {
setErrorMessage(reply->errorString());
}
......@@ -78,7 +78,7 @@ AbstractQueryModel::AbstractQueryModel(AbstractQueryModelPrivate* dd, QObject* p
connect(AssetRepository::instance(), &AssetRepository::downloadFinished, this, [this]() {
const auto rows = rowCount();
if (rows > 0) {
emit dataChanged(index(0, 0), index(rows - 1, 0));
Q_EMIT dataChanged(index(0, 0), index(rows - 1, 0));
}
});
}
......@@ -97,7 +97,7 @@ void AbstractQueryModel::setManager(Manager *mgr)
}
d_ptr->m_manager = mgr;
emit managerChanged();
Q_EMIT managerChanged();
d_ptr->query();
}
......@@ -142,7 +142,7 @@ void AbstractQueryModel::clear()
if (!d_ptr->m_attributions.empty()) {
d_ptr->m_attributions.clear();
emit attributionsChanged();
Q_EMIT attributionsChanged();
}
d_ptr->setErrorMessage({});
......
......@@ -176,10 +176,10 @@ void BackendModel::setManager(Manager *mgr)
d->mgr = mgr;
connect(mgr, &Manager::configurationChanged, this, [this]() {
emit dataChanged(index(0, 0), index(rowCount() - 1, 0));
Q_EMIT dataChanged(index(0, 0), index(rowCount() - 1, 0));
});
d->repopulateModel(this);
emit managerChanged();
Q_EMIT managerChanged();
}
BackendModel::Mode BackendModel::mode() const
......@@ -194,7 +194,7 @@ void BackendModel::setMode(BackendModel::Mode mode)
}
d->mode = mode;
emit modeChanged();
Q_EMIT modeChanged();
d->repopulateModel(this);
}
......
......@@ -47,7 +47,7 @@ void JourneyQueryModelPrivate::doQuery()
setLoading(true);
m_nextRequest = {};
m_prevRequest = {};
emit q->canQueryPrevNextChanged();
Q_EMIT q->canQueryPrevNextChanged();
auto reply = m_manager->queryJourney(m_request);
monitorReply(reply);
......@@ -56,7 +56,7 @@ void JourneyQueryModelPrivate::doQuery()
if (reply->error() == KPublicTransport::JourneyReply::NoError) {
m_nextRequest = reply->nextRequest();
m_prevRequest = reply->previousRequest();
emit q->canQueryPrevNextChanged();
Q_EMIT q->canQueryPrevNextChanged();
}
});
QObject::connect(reply, &KPublicTransport::JourneyReply::updated, q, [reply, this]() {
......@@ -82,7 +82,7 @@ void JourneyQueryModelPrivate::mergeResults(const std::vector<Journey> &newJourn
found = true;
const auto row = std::distance(m_journeys.begin(), it);
const auto idx = q->index(row, 0);
emit q->dataChanged(idx, idx);
Q_EMIT q->dataChanged(idx, idx);
break;
} else {
++it;
......@@ -118,7 +118,7 @@ void JourneyQueryModel::setRequest(const JourneyRequest &req)
{
Q_D(JourneyQueryModel);
d->m_request = req;
emit requestChanged();
Q_EMIT requestChanged();
d->query();
}
......@@ -146,7 +146,7 @@ void JourneyQueryModel::queryNext()
} else {
d->m_nextRequest = {};
}
emit canQueryPrevNextChanged();
Q_EMIT canQueryPrevNextChanged();
});
QObject::connect(reply, &KPublicTransport::JourneyReply::updated, this, [reply, this]() {
Q_D(JourneyQueryModel);
......@@ -178,7 +178,7 @@ void JourneyQueryModel::queryPrevious()
} else {
d->m_prevRequest = {};
}
emit canQueryPrevNextChanged();
Q_EMIT canQueryPrevNextChanged();
});
QObject::connect(reply, &KPublicTransport::JourneyReply::updated, this, [reply, this]() {
Q_D(JourneyQueryModel);
......
......@@ -88,7 +88,7 @@ void LocationQueryModelPrivate::mergeResults(const std::vector<Location> &newLoc
found = true;
const auto row = std::distance(m_locations.begin(), it);
const auto idx = q->index(row, 0);
emit q->dataChanged(idx, idx);
Q_EMIT q->dataChanged(idx, idx);
break;
}
}
......@@ -125,7 +125,7 @@ void LocationQueryModel::setRequest(const LocationRequest &req)
{
Q_D(LocationQueryModel);
d->m_request = req;
emit requestChanged();
Q_EMIT requestChanged();
d->query();
}
......
......@@ -47,7 +47,7 @@ void StopoverQueryModelPrivate::doQuery()
setLoading(true);
m_nextRequest = {};
m_prevRequest = {};
emit q->canQueryPrevNextChanged();
Q_EMIT q->canQueryPrevNextChanged();
auto reply = m_manager->queryStopover(m_request);
monitorReply(reply);
......@@ -55,7 +55,7 @@ void StopoverQueryModelPrivate::doQuery()
if (reply->error() == KPublicTransport::StopoverReply::NoError) {
m_nextRequest = reply->nextRequest();
m_prevRequest = reply->previousRequest();
emit q->canQueryPrevNextChanged();
Q_EMIT q->canQueryPrevNextChanged();
}
});
QObject::connect(reply, &KPublicTransport::StopoverReply::updated,q, [reply, this]() {
......@@ -83,7 +83,7 @@ void StopoverQueryModelPrivate::mergeResults(const std::vector<Stopover> &newDep
found = true;
const auto row = std::distance(m_departures.begin(), it);
const auto idx = q->index(row, 0);
emit q->dataChanged(idx, idx);
Q_EMIT q->dataChanged(idx, idx);
break;
} else {
++it;
......@@ -119,7 +119,7 @@ void StopoverQueryModel::setRequest(const StopoverRequest &req)
{
Q_D(StopoverQueryModel);
d->m_request = req;
emit requestChanged();
Q_EMIT requestChanged();
d->query();
}
......@@ -147,7 +147,7 @@ void StopoverQueryModel::queryNext()
} else {
d->m_nextRequest = {};
}
emit canQueryPrevNextChanged();
Q_EMIT canQueryPrevNextChanged();
});
QObject::connect(reply, &KPublicTransport::StopoverReply::updated, this, [reply, this]() {
Q_D(StopoverQueryModel);
......@@ -179,7 +179,7 @@ void StopoverQueryModel::queryPrevious()
} else {
d->m_prevRequest = {};
}
emit canQueryPrevNextChanged();
Q_EMIT canQueryPrevNextChanged();
});
QObject::connect(reply, &KPublicTransport::StopoverReply::updated, this, [reply, this]() {
Q_D(StopoverQueryModel);
......
......@@ -45,7 +45,7 @@ void VehicleLayoutQueryModelPrivate::doQuery()
q->beginResetModel();
m_stopover = m_request.stopover();
q->endResetModel();
emit q->contentChanged();
Q_EMIT q->contentChanged();
setLoading(true);
auto reply = m_manager->queryVehicleLayout(m_request);
......@@ -59,7 +59,7 @@ void VehicleLayoutQueryModelPrivate::doQuery()
interpolatePlatformPositionsFromSectionName();
}
q->endResetModel();
emit q->contentChanged();
Q_EMIT q->contentChanged();
});
}
......@@ -67,7 +67,7 @@ void VehicleLayoutQueryModelPrivate::doClearResults()
{
m_stopover = {};
Q_Q(VehicleLayoutQueryModel);
emit q->contentChanged();
Q_EMIT q->contentChanged();
}
void VehicleLayoutQueryModelPrivate::interpolatePlatformPositionsFromSectionName()
......@@ -156,7 +156,7 @@ void VehicleLayoutQueryModel::setRequest(const VehicleLayoutRequest &req)
{
Q_D(VehicleLayoutQueryModel);
d->m_request = req;
emit requestChanged();
Q_EMIT requestChanged();
d->query();
}
......
......@@ -66,7 +66,7 @@ void EndpointProber::processNext()
return;
}
if (m_queue.empty()) {
emit finished();
Q_EMIT finished();
return;
}
......
......@@ -88,12 +88,12 @@ bool WikidataEntitiesQuery::processReply(QNetworkReply *reply)
for (auto it = entities.begin(); it != entities.end(); ++it) {
m_result.push_back(wd::Item(wd::Q(it.key()), it.value().toObject()));
}
emit partialResult(this);
Q_EMIT partialResult(this);
if (m_nextBatch < m_items.size()) {
return false;
} else {
emit finished();
Q_EMIT finished();
return true;
}
}
......@@ -147,12 +147,12 @@ bool WikidataImageMetadataQuery::processReply(QNetworkReply *reply)
for (const auto &img : images) {
m_result.push_back(wd::Image(img.toObject()));
}
emit partialResult(this);
Q_EMIT partialResult(this);
if (m_nextBatch < m_images.size()) {
return false;
} else {
emit finished();
Q_EMIT finished();
return true;
}
}
......@@ -49,7 +49,7 @@ void WikidataQueryManager::subQueryFinished(WikidataQuery *query, QNetworkReply
if (reply->error() != QNetworkReply::NoError) {
qWarning() << reply->errorString();
query->m_error = WikidataQuery::NetworkError;
emit query->finished();
Q_EMIT query->finished();
return;
}
......
Supports Markdown
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