Commit 6c1e8135 authored by Nicolas Fella's avatar Nicolas Fella

Use ECM and install files

parent 1714faba
cmake_minimum_required(VERSION 3.0)
find_package(ECM 5.38 REQUIRED NO_MODULE)
set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH} ${ECM_KDE_MODULE_DIR} ${CMAKE_SOURCE_DIR}/cmake)
include(KDEFrameworkCompilerSettings NO_POLICY_SCOPE)
include(ECMAddTests)
include(ECMGenerateHeaders)
include(ECMQtDeclareLoggingCategory)
include(ECMSetupVersion)
include(FeatureSummary)
include(KDEInstallDirs)
include(KDECMakeSettings)
find_package(Qt5 REQUIRED COMPONENTS Gui Qml Widgets)
find_package(KPublicTransport REQUIRED)
......
......@@ -2,3 +2,8 @@ qt5_add_resources(ktrip_SRCS resources.qrc)
add_executable(ktrip main.cpp querycontroller.cpp locationquerymodel.cpp ${ktrip_SRCS})
target_link_libraries(ktrip Qt5::Qml Qt5::Gui Qt5::Widgets KPublicTransport)
install(TARGETS ktrip ${INSTALL_TARGETS_DEFAULT_ARGS})
if (NOT ANDROID)
install(PROGRAMS org.kde.ktrip.desktop DESTINATION ${KDE_INSTALL_APPDIR})
endif()
......@@ -41,7 +41,7 @@ QVariant LocationQueryModel::data(const QModelIndex& index, int role) const
case ObjectRole:
return QVariant::fromValue(m_locations[index.row()]);
default:
return QVariant("deadbeef");
return QVariant(QStringLiteral("deadbeef"));
}
}
......
......@@ -16,7 +16,7 @@ int main(int argc, char *argv[])
qmlRegisterType<KPublicTransport::JourneyQueryModel>("org.kde.ktrip", 0, 1, "JourneyQueryModel");
QueryController queryController;
engine.rootContext()->setContextProperty("_queryController", &queryController);
engine.rootContext()->setContextProperty(QStringLiteral("_queryController"), &queryController);
return app.exec();
}
[Desktop Entry]
Name=KTrip
GenericName=Public transport navigator
Exec=ktrip
Icon=map-globe
Type=Application
Comment=Public transport navigator.
Terminal=false
Categories=Qt;KDE;
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