mirror of
https://github.com/allankoechke/foodrescue-app.git
synced 2026-11-30 10:17:37 +00:00
initial commit
Empty application template using the standard KDE CMake system. Builds on desktop Linux; should build on Android but untested.
This commit is contained in:
6
.gitignore
vendored
Normal file
6
.gitignore
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
# Ignore Qt Creator user settings.
|
||||
# (As they can be burdensome to create, an example is provided in CMakeLists.txt.user.template.)
|
||||
/CMakeLists.txt.user
|
||||
|
||||
# Ignore build output, as configured in CMakeLists.txt.user.template.
|
||||
/build/
|
||||
58
CMakeLists.txt
Normal file
58
CMakeLists.txt
Normal file
@@ -0,0 +1,58 @@
|
||||
cmake_minimum_required(VERSION 3.0)
|
||||
|
||||
set(KF5_VERSION "5.47.0") # handled by release scripts
|
||||
set(KF5_DEP_VERSION "5.47.0") # handled by release scripts
|
||||
|
||||
project(foodrescue-app VERSION ${KF5_VERSION})
|
||||
|
||||
set(REQUIRED_QT_VERSION 5.8.0)
|
||||
|
||||
SET(CMAKE_CXX_STANDARD 11)
|
||||
|
||||
################# Disallow in-source build #################
|
||||
|
||||
if("${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_BINARY_DIR}")
|
||||
message(FATAL_ERROR "foodrescue-app requires an out of source build. Please create a separate build directory and run 'cmake path_to_kirigami [options]' there.")
|
||||
endif()
|
||||
|
||||
# Make CPack available to easy generate binary packages
|
||||
include(CPack)
|
||||
include(FeatureSummary)
|
||||
|
||||
find_package(Qt5 ${REQUIRED_QT_VERSION} REQUIRED NO_MODULE COMPONENTS Core Quick Gui Svg QuickControls2)
|
||||
|
||||
set(CMAKE_AUTOMOC ON)
|
||||
set(AUTOMOC_MOC_OPTIONS -Muri=org.kde.kirigami)
|
||||
set(CMAKE_INCLUDE_CURRENT_DIR ON)
|
||||
|
||||
################# set KDE specific information #################
|
||||
|
||||
find_package(ECM 5.47.0 NO_MODULE)
|
||||
set_package_properties(ECM PROPERTIES TYPE REQUIRED DESCRIPTION "Extra CMake Modules." URL "https://projects.kde.org/projects/kdesupport/extra-cmake-modules")
|
||||
|
||||
# where to look first for cmake modules, before ${CMAKE_ROOT}/Modules/ is checked
|
||||
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${ECM_MODULE_PATH})
|
||||
|
||||
include(KDEInstallDirs)
|
||||
include(KDECMakeSettings)
|
||||
include(KDECompilerSettings NO_POLICY_SCOPE)
|
||||
include(ECMPoQmTools)
|
||||
include(ECMQMLModules)
|
||||
|
||||
if(CMAKE_SYSTEM_NAME STREQUAL "Android")
|
||||
find_package(Qt5AndroidExtras ${REQUIRED_QT_VERSION} REQUIRED)
|
||||
endif()
|
||||
|
||||
|
||||
ecm_find_qmlmodule(QtGraphicalEffects 1.0)
|
||||
|
||||
add_definitions(-DQT_NO_URL_CAST_FROM_STRING)
|
||||
|
||||
add_subdirectory(src)
|
||||
|
||||
if (IS_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/po")
|
||||
ecm_install_po_files_as_qm(po)
|
||||
endif()
|
||||
|
||||
feature_summary(WHAT ALL INCLUDE_QUIET_PACKAGES FATAL_ON_MISSING_REQUIRED_PACKAGES)
|
||||
|
||||
282
CMakeLists.txt.user.template
Normal file
282
CMakeLists.txt.user.template
Normal file
@@ -0,0 +1,282 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE QtCreatorProject>
|
||||
<!-- Written by QtCreator 4.12.1, 2020-06-02T01:11:50. -->
|
||||
<qtcreator>
|
||||
<data>
|
||||
<variable>EnvironmentId</variable>
|
||||
<value type="QByteArray">{260b20d3-159d-4ccf-aece-265ee3167f2f}</value>
|
||||
</data>
|
||||
<data>
|
||||
<variable>ProjectExplorer.Project.ActiveTarget</variable>
|
||||
<value type="int">0</value>
|
||||
</data>
|
||||
<data>
|
||||
<variable>ProjectExplorer.Project.EditorSettings</variable>
|
||||
<valuemap type="QVariantMap">
|
||||
<value type="bool" key="EditorConfiguration.AutoIndent">true</value>
|
||||
<value type="bool" key="EditorConfiguration.AutoSpacesForTabs">false</value>
|
||||
<value type="bool" key="EditorConfiguration.CamelCaseNavigation">true</value>
|
||||
<valuemap type="QVariantMap" key="EditorConfiguration.CodeStyle.0">
|
||||
<value type="QString" key="language">Cpp</value>
|
||||
<valuemap type="QVariantMap" key="value">
|
||||
<value type="QByteArray" key="CurrentPreferences">CppGlobal</value>
|
||||
</valuemap>
|
||||
</valuemap>
|
||||
<valuemap type="QVariantMap" key="EditorConfiguration.CodeStyle.1">
|
||||
<value type="QString" key="language">QmlJS</value>
|
||||
<valuemap type="QVariantMap" key="value">
|
||||
<value type="QByteArray" key="CurrentPreferences">QmlJSGlobal</value>
|
||||
</valuemap>
|
||||
</valuemap>
|
||||
<value type="int" key="EditorConfiguration.CodeStyle.Count">2</value>
|
||||
<value type="QByteArray" key="EditorConfiguration.Codec">UTF-8</value>
|
||||
<value type="bool" key="EditorConfiguration.ConstrainTooltips">false</value>
|
||||
<value type="int" key="EditorConfiguration.IndentSize">4</value>
|
||||
<value type="bool" key="EditorConfiguration.KeyboardTooltips">false</value>
|
||||
<value type="int" key="EditorConfiguration.MarginColumn">80</value>
|
||||
<value type="bool" key="EditorConfiguration.MouseHiding">true</value>
|
||||
<value type="bool" key="EditorConfiguration.MouseNavigation">true</value>
|
||||
<value type="int" key="EditorConfiguration.PaddingMode">1</value>
|
||||
<value type="bool" key="EditorConfiguration.ScrollWheelZooming">true</value>
|
||||
<value type="bool" key="EditorConfiguration.ShowMargin">false</value>
|
||||
<value type="int" key="EditorConfiguration.SmartBackspaceBehavior">0</value>
|
||||
<value type="bool" key="EditorConfiguration.SmartSelectionChanging">true</value>
|
||||
<value type="bool" key="EditorConfiguration.SpacesForTabs">true</value>
|
||||
<value type="int" key="EditorConfiguration.TabKeyBehavior">0</value>
|
||||
<value type="int" key="EditorConfiguration.TabSize">8</value>
|
||||
<value type="bool" key="EditorConfiguration.UseGlobal">true</value>
|
||||
<value type="int" key="EditorConfiguration.Utf8BomBehavior">1</value>
|
||||
<value type="bool" key="EditorConfiguration.addFinalNewLine">true</value>
|
||||
<value type="bool" key="EditorConfiguration.cleanIndentation">true</value>
|
||||
<value type="bool" key="EditorConfiguration.cleanWhitespace">true</value>
|
||||
<value type="bool" key="EditorConfiguration.inEntireDocument">false</value>
|
||||
</valuemap>
|
||||
</data>
|
||||
<data>
|
||||
<variable>ProjectExplorer.Project.PluginSettings</variable>
|
||||
<valuemap type="QVariantMap">
|
||||
<valuemap type="QVariantMap" key="AutoTest.ActiveFrameworks">
|
||||
<value type="bool" key="AutoTest.Framework.Boost">true</value>
|
||||
<value type="bool" key="AutoTest.Framework.GTest">true</value>
|
||||
<value type="bool" key="AutoTest.Framework.QtQuickTest">true</value>
|
||||
<value type="bool" key="AutoTest.Framework.QtTest">true</value>
|
||||
</valuemap>
|
||||
<value type="int" key="AutoTest.RunAfterBuild">0</value>
|
||||
<value type="bool" key="AutoTest.UseGlobal">true</value>
|
||||
<valuelist type="QVariantList" key="ClangCodeModel.CustomCommandLineKey"/>
|
||||
<value type="bool" key="ClangCodeModel.UseGlobalConfig">true</value>
|
||||
<value type="QString" key="ClangCodeModel.WarningConfigId">Builtin.Questionable</value>
|
||||
<valuemap type="QVariantMap" key="ClangTools">
|
||||
<value type="bool" key="ClangTools.BuildBeforeAnalysis">true</value>
|
||||
<value type="QString" key="ClangTools.DiagnosticConfig">Builtin.DefaultTidyAndClazy</value>
|
||||
<value type="int" key="ClangTools.ParallelJobs">2</value>
|
||||
<valuelist type="QVariantList" key="ClangTools.SelectedDirs"/>
|
||||
<valuelist type="QVariantList" key="ClangTools.SelectedFiles"/>
|
||||
<valuelist type="QVariantList" key="ClangTools.SuppressedDiagnostics"/>
|
||||
<value type="bool" key="ClangTools.UseGlobalSettings">true</value>
|
||||
</valuemap>
|
||||
</valuemap>
|
||||
</data>
|
||||
<data>
|
||||
<variable>ProjectExplorer.Project.Target.0</variable>
|
||||
<valuemap type="QVariantMap">
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Desktop (KDE kit, system Qt)</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Desktop (KDE kit, system Qt)</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">{e4b5adc8-36e6-4796-9cab-958c3876147a}</value>
|
||||
<value type="int" key="ProjectExplorer.Target.ActiveBuildConfiguration">1</value>
|
||||
<value type="int" key="ProjectExplorer.Target.ActiveDeployConfiguration">0</value>
|
||||
<value type="int" key="ProjectExplorer.Target.ActiveRunConfiguration">0</value>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.0">
|
||||
<valuelist type="QVariantList" key="CMake.Configuration">
|
||||
<value type="QString">CMAKE_BUILD_TYPE:STRING=Debug</value>
|
||||
<value type="QString">CMAKE_CXX_COMPILER:FILEPATH=/usr/bin/c++</value>
|
||||
<value type="QString">CMAKE_C_COMPILER:FILEPATH=/usr/bin/cc</value>
|
||||
<value type="QString">CMAKE_PREFIX_PATH:STRING=%{Qt:QT_INSTALL_PREFIX}</value>
|
||||
<value type="QString">QT_QMAKE_EXECUTABLE:STRING=%{Qt:qmakeExecutable}</value>
|
||||
</valuelist>
|
||||
<value type="int" key="EnableQmlDebugging">2</value>
|
||||
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">/home/matthias/Projects/Fairdirect.Food_Rescue_App/Repo.foodrescue-app/build/Desktop.KDE_kit+system_Qt.Debug</value>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
|
||||
<value type="QString" key="CMakeProjectManager.MakeStep.AdditionalArguments"></value>
|
||||
<valuelist type="QVariantList" key="CMakeProjectManager.MakeStep.BuildTargets">
|
||||
<value type="QString">all</value>
|
||||
</valuelist>
|
||||
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">CMakeProjectManager.MakeStep</value>
|
||||
</valuemap>
|
||||
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Build</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Build</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value>
|
||||
</valuemap>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1">
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
|
||||
<value type="QString" key="CMakeProjectManager.MakeStep.AdditionalArguments"></value>
|
||||
<valuelist type="QVariantList" key="CMakeProjectManager.MakeStep.BuildTargets">
|
||||
<value type="QString">clean</value>
|
||||
</valuelist>
|
||||
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">CMakeProjectManager.MakeStep</value>
|
||||
</valuemap>
|
||||
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Clean</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Clean</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value>
|
||||
</valuemap>
|
||||
<value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value>
|
||||
<value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value>
|
||||
<valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Debug</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">CMakeProjectManager.CMakeBuildConfiguration</value>
|
||||
</valuemap>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.1">
|
||||
<valuelist type="QVariantList" key="CMake.Configuration">
|
||||
<value type="QString">CMAKE_BUILD_TYPE:STRING=Release</value>
|
||||
<value type="QString">CMAKE_CXX_COMPILER:STRING=%{Compiler:Executable:Cxx}</value>
|
||||
<value type="QString">CMAKE_C_COMPILER:STRING=%{Compiler:Executable:C}</value>
|
||||
<value type="QString">CMAKE_PREFIX_PATH:STRING=%{Qt:QT_INSTALL_PREFIX}</value>
|
||||
<value type="QString">QT_QMAKE_EXECUTABLE:STRING=%{Qt:qmakeExecutable}</value>
|
||||
</valuelist>
|
||||
<value type="int" key="EnableQmlDebugging">2</value>
|
||||
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">/home/matthias/Projects/Fairdirect.Food_Rescue_App/Repo.foodrescue-app/build/Desktop.KDE_kit+system_Qt.Release</value>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
|
||||
<value type="QString" key="CMakeProjectManager.MakeStep.AdditionalArguments"></value>
|
||||
<valuelist type="QVariantList" key="CMakeProjectManager.MakeStep.BuildTargets">
|
||||
<value type="QString">all</value>
|
||||
</valuelist>
|
||||
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">CMakeProjectManager.MakeStep</value>
|
||||
</valuemap>
|
||||
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Build</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Build</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value>
|
||||
</valuemap>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1">
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
|
||||
<value type="QString" key="CMakeProjectManager.MakeStep.AdditionalArguments"></value>
|
||||
<valuelist type="QVariantList" key="CMakeProjectManager.MakeStep.BuildTargets">
|
||||
<value type="QString">clean</value>
|
||||
</valuelist>
|
||||
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">CMakeProjectManager.MakeStep</value>
|
||||
</valuemap>
|
||||
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Clean</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Clean</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value>
|
||||
</valuemap>
|
||||
<value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value>
|
||||
<value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value>
|
||||
<valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Release</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">CMakeProjectManager.CMakeBuildConfiguration</value>
|
||||
</valuemap>
|
||||
<value type="int" key="ProjectExplorer.Target.BuildConfigurationCount">2</value>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.Target.DeployConfiguration.0">
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
|
||||
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">0</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Deploy</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Deploy</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Deploy</value>
|
||||
</valuemap>
|
||||
<value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">1</value>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.DeployConfiguration.CustomData"/>
|
||||
<value type="bool" key="ProjectExplorer.DeployConfiguration.CustomDataEnabled">false</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.DefaultDeployConfiguration</value>
|
||||
</valuemap>
|
||||
<value type="int" key="ProjectExplorer.Target.DeployConfigurationCount">1</value>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.Target.PluginSettings"/>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.Target.RunConfiguration.0">
|
||||
<value type="QString" key="Analyzer.Perf.CallgraphMode">dwarf</value>
|
||||
<valuelist type="QVariantList" key="Analyzer.Perf.Events">
|
||||
<value type="QString">cpu-cycles</value>
|
||||
</valuelist>
|
||||
<valuelist type="QVariantList" key="Analyzer.Perf.ExtraArguments"/>
|
||||
<value type="int" key="Analyzer.Perf.Frequency">250</value>
|
||||
<valuelist type="QVariantList" key="Analyzer.Perf.RecordArguments">
|
||||
<value type="QString">-e</value>
|
||||
<value type="QString">cpu-cycles</value>
|
||||
<value type="QString">--call-graph</value>
|
||||
<value type="QString">dwarf,4096</value>
|
||||
<value type="QString">-F</value>
|
||||
<value type="QString">250</value>
|
||||
</valuelist>
|
||||
<value type="QString" key="Analyzer.Perf.SampleMode">-F</value>
|
||||
<value type="bool" key="Analyzer.Perf.Settings.UseGlobalSettings">true</value>
|
||||
<value type="int" key="Analyzer.Perf.StackSize">4096</value>
|
||||
<value type="bool" key="Analyzer.QmlProfiler.AggregateTraces">false</value>
|
||||
<value type="bool" key="Analyzer.QmlProfiler.FlushEnabled">false</value>
|
||||
<value type="uint" key="Analyzer.QmlProfiler.FlushInterval">1000</value>
|
||||
<value type="QString" key="Analyzer.QmlProfiler.LastTraceFile"></value>
|
||||
<value type="bool" key="Analyzer.QmlProfiler.Settings.UseGlobalSettings">true</value>
|
||||
<valuelist type="QVariantList" key="Analyzer.Valgrind.AddedSuppressionFiles"/>
|
||||
<value type="bool" key="Analyzer.Valgrind.Callgrind.CollectBusEvents">false</value>
|
||||
<value type="bool" key="Analyzer.Valgrind.Callgrind.CollectSystime">false</value>
|
||||
<value type="bool" key="Analyzer.Valgrind.Callgrind.EnableBranchSim">false</value>
|
||||
<value type="bool" key="Analyzer.Valgrind.Callgrind.EnableCacheSim">false</value>
|
||||
<value type="bool" key="Analyzer.Valgrind.Callgrind.EnableEventToolTips">true</value>
|
||||
<value type="double" key="Analyzer.Valgrind.Callgrind.MinimumCostRatio">0.01</value>
|
||||
<value type="double" key="Analyzer.Valgrind.Callgrind.VisualisationMinimumCostRatio">10</value>
|
||||
<value type="bool" key="Analyzer.Valgrind.FilterExternalIssues">true</value>
|
||||
<value type="QString" key="Analyzer.Valgrind.KCachegrindExecutable">kcachegrind</value>
|
||||
<value type="int" key="Analyzer.Valgrind.LeakCheckOnFinish">1</value>
|
||||
<value type="int" key="Analyzer.Valgrind.NumCallers">25</value>
|
||||
<valuelist type="QVariantList" key="Analyzer.Valgrind.RemovedSuppressionFiles"/>
|
||||
<value type="int" key="Analyzer.Valgrind.SelfModifyingCodeDetection">1</value>
|
||||
<value type="bool" key="Analyzer.Valgrind.Settings.UseGlobalSettings">true</value>
|
||||
<value type="bool" key="Analyzer.Valgrind.ShowReachable">false</value>
|
||||
<value type="bool" key="Analyzer.Valgrind.TrackOrigins">true</value>
|
||||
<value type="QString" key="Analyzer.Valgrind.ValgrindExecutable">valgrind</value>
|
||||
<valuelist type="QVariantList" key="Analyzer.Valgrind.VisibleErrorKinds">
|
||||
<value type="int">0</value>
|
||||
<value type="int">1</value>
|
||||
<value type="int">2</value>
|
||||
<value type="int">3</value>
|
||||
<value type="int">4</value>
|
||||
<value type="int">5</value>
|
||||
<value type="int">6</value>
|
||||
<value type="int">7</value>
|
||||
<value type="int">8</value>
|
||||
<value type="int">9</value>
|
||||
<value type="int">10</value>
|
||||
<value type="int">11</value>
|
||||
<value type="int">12</value>
|
||||
<value type="int">13</value>
|
||||
<value type="int">14</value>
|
||||
</valuelist>
|
||||
<value type="int" key="PE.EnvironmentAspect.Base">2</value>
|
||||
<valuelist type="QVariantList" key="PE.EnvironmentAspect.Changes"/>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">foodrescue</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">CMakeProjectManager.CMakeRunConfiguration.foodrescue</value>
|
||||
<value type="QString" key="ProjectExplorer.RunConfiguration.BuildKey">foodrescue</value>
|
||||
<value type="QString" key="RunConfiguration.Arguments"></value>
|
||||
<value type="bool" key="RunConfiguration.Arguments.multi">false</value>
|
||||
<value type="QString" key="RunConfiguration.OverrideDebuggerStartup"></value>
|
||||
<value type="bool" key="RunConfiguration.UseCppDebugger">false</value>
|
||||
<value type="bool" key="RunConfiguration.UseCppDebuggerAuto">true</value>
|
||||
<value type="bool" key="RunConfiguration.UseLibrarySearchPath">true</value>
|
||||
<value type="bool" key="RunConfiguration.UseMultiProcess">false</value>
|
||||
<value type="bool" key="RunConfiguration.UseQmlDebugger">false</value>
|
||||
<value type="bool" key="RunConfiguration.UseQmlDebuggerAuto">true</value>
|
||||
<value type="QString" key="RunConfiguration.WorkingDirectory"></value>
|
||||
<value type="QString" key="RunConfiguration.WorkingDirectory.default">/home/matthias/Projects/Fairdirect.Food_Rescue_App/Repo.foodrescue-app/build/Desktop.KDE_kit+system_Qt.Release/bin</value>
|
||||
</valuemap>
|
||||
<value type="int" key="ProjectExplorer.Target.RunConfigurationCount">1</value>
|
||||
</valuemap>
|
||||
</data>
|
||||
<data>
|
||||
<variable>ProjectExplorer.Project.TargetCount</variable>
|
||||
<value type="int">1</value>
|
||||
</data>
|
||||
<data>
|
||||
<variable>ProjectExplorer.Project.Updater.FileVersion</variable>
|
||||
<value type="int">22</value>
|
||||
</data>
|
||||
<data>
|
||||
<variable>Version</variable>
|
||||
<value type="int">22</value>
|
||||
</data>
|
||||
</qtcreator>
|
||||
24
metadata.desktop
Normal file
24
metadata.desktop
Normal file
@@ -0,0 +1,24 @@
|
||||
[Desktop Entry]
|
||||
Name=Food Rescue
|
||||
Name[de]=LebensmittelRetter
|
||||
GenericName=Food Rescue Information Browser
|
||||
GenericName[de]=Lebensmittel-Haltbarkeits-Informierer
|
||||
Comment=Helps to assess if food is still edible.
|
||||
Comment[de]=Hilft zu entscheiden, ob Lebensmittel noch essbar sind.
|
||||
|
||||
Type=Application
|
||||
Exec=foodrescue
|
||||
Icon=preferences-desktop-theme
|
||||
Categories=Qt;KDE;
|
||||
|
||||
X-KDE-ParentApp=
|
||||
X-KDE-PluginInfo-Author=Matthias Ansorg
|
||||
X-KDE-PluginInfo-Email=matthias@ansorgs.de
|
||||
X-KDE-PluginInfo-Name=org.fairdirect.foodrescue
|
||||
X-KDE-PluginInfo-Version=0.1
|
||||
X-KDE-PluginInfo-Website=
|
||||
X-KDE-PluginInfo-Category=
|
||||
X-KDE-PluginInfo-Depends=
|
||||
X-KDE-PluginInfo-License=
|
||||
X-KDE-PluginInfo-EnabledByDefault=false
|
||||
X-Plasma-MainScript=
|
||||
45
org.fairdirect.foodrescue.appdata.xml
Normal file
45
org.fairdirect.foodrescue.appdata.xml
Normal file
@@ -0,0 +1,45 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<component type="desktop-application">
|
||||
<id>org.fairdirect.foodrescue</id>
|
||||
<metadata_license>FSFAP</metadata_license>
|
||||
<project_license>MIT</project_license>
|
||||
|
||||
<name>Food Rescue</name>
|
||||
<name xml:lang="de">Lebensmittel-Rettung</name>
|
||||
|
||||
<summary>Helps to assess if food is still edible.</summary>
|
||||
<summary xml:lang="de">Hilft zu entscheiden, ob Lebensmittel noch essbar sind.</summary>
|
||||
|
||||
<description>
|
||||
<p>See https://fairdirect.org/food-rescue-app</p>
|
||||
<p xml:lang="de">Siehe https://fairdirect.org/realmhd-app</p>
|
||||
</description>
|
||||
|
||||
<url type="homepage">https://fairdirect.org/food-rescue-app</url>
|
||||
<url type="bugtracker">https://github.com/fairdirect/foodrescue-app/issues</url>
|
||||
<url type="donation"></url>
|
||||
|
||||
<developer_name>Matthias Ansorg <matthias@ansorgs.de></developer_name>
|
||||
|
||||
<icon type="stock">preferences-desktop-theme</icon>
|
||||
|
||||
<launchable type="desktop-id">org.fairirect.foodrescue.desktop</launchable>
|
||||
|
||||
<screenshots>
|
||||
<screenshot type="default">
|
||||
<image>
|
||||
<!--
|
||||
see https://www.freedesktop.org/software/appstream/docs/chap-Metadata.html#tag-screenshots
|
||||
Central hosting for uploading at https://phabricator.kde.org/source/websites-product-screenshots/
|
||||
Central URL to use here https://cdn.kde.org/screenshots/...
|
||||
-->
|
||||
</image>
|
||||
</screenshot>
|
||||
</screenshots>
|
||||
|
||||
<provides>
|
||||
<binary>foodrescue</binary>
|
||||
</provides>
|
||||
|
||||
<project_group>KDE</project_group>
|
||||
</component>
|
||||
86
src/CMakeLists.txt
Normal file
86
src/CMakeLists.txt
Normal file
@@ -0,0 +1,86 @@
|
||||
# ------------------------- BEGIN: lists to maintain manually -------------------------
|
||||
|
||||
# Define the application source files to be compiled.
|
||||
set(foodrescue_SRCS
|
||||
main.cpp
|
||||
)
|
||||
|
||||
# Define Qt Resource Collection (.qrc) files, to include the resource files listed there.
|
||||
qt5_add_resources(RESOURCES
|
||||
resources.qrc
|
||||
)
|
||||
|
||||
# Define libraries to link statically with the application.
|
||||
# (Needed on Android only, as desktop systems should supply these system-wide.)
|
||||
if (CMAKE_SYSTEM_NAME STREQUAL "Android")
|
||||
find_package(KF5Kirigami2 ${KF5_DEP_VERSION})
|
||||
set(foodrescue_EXTRA_LIBS Qt5::AndroidExtras
|
||||
KF5::Kirigami2
|
||||
# FIXME: Linking with QQC2 should not be needed. But if we don't, the lib will not be
|
||||
# included into the Android APK package.
|
||||
Qt5::QuickControls2
|
||||
)
|
||||
endif()
|
||||
|
||||
# Include in-use icons with the Android APK package.
|
||||
if (CMAKE_SYSTEM_NAME STREQUAL "Android")
|
||||
find_package(KF5Kirigami2 REQUIRED)
|
||||
kirigami_package_breeze_icons(ICONS
|
||||
applications-graphics
|
||||
configure
|
||||
)
|
||||
endif()
|
||||
|
||||
# ------------------------- END: lists to maintain manually -------------------------
|
||||
|
||||
|
||||
# Generate KDE AppStream meta information about the application, to integrate it with KDE.
|
||||
# (This is not an essential build step though. Disable when not working.)
|
||||
find_program(kpackagetool_cmd kpackagetool5)
|
||||
if (kpackagetool_cmd)
|
||||
set(component org.fairdirect.foodrescue)
|
||||
set(APPDATAFILE "${CMAKE_CURRENT_BINARY_DIR}/${component}.appdata.xml")
|
||||
|
||||
message(STATUS "${kpackagetool_cmd} --appstream-metainfo ${CMAKE_CURRENT_SOURCE_DIR}/data --appstream-metainfo-output ${APPDATAFILE}")
|
||||
execute_process(
|
||||
COMMAND ${kpackagetool_cmd} --appstream-metainfo ${CMAKE_CURRENT_SOURCE_DIR} --appstream-metainfo-output ${APPDATAFILE}
|
||||
ERROR_VARIABLE appstreamerror
|
||||
RESULT_VARIABLE result
|
||||
)
|
||||
|
||||
if (NOT result EQUAL 0)
|
||||
message(WARNING "couldn't generate metainfo for ${component}: ${appstreamerror}")
|
||||
else()
|
||||
if(appstreamerror)
|
||||
message(WARNING "warnings during generation of metainfo for ${component}: ${appstreamerror}")
|
||||
endif()
|
||||
|
||||
install(
|
||||
FILES ${APPDATAFILE}
|
||||
DESTINATION ${KDE_INSTALL_METAINFODIR}
|
||||
OPTIONAL # Because "NoDisplay" .desktop files will render no XML.
|
||||
)
|
||||
endif()
|
||||
else()
|
||||
message(WARNING "Could not find command kpackagetool5. Appstream information won't be generated for ${component}.")
|
||||
endif()
|
||||
|
||||
# Define the name of the executable.
|
||||
add_executable(foodrescue ${foodrescue_SRCS} ${RESOURCES})
|
||||
|
||||
# Link all required libraries with the executable.
|
||||
target_link_libraries(foodrescue
|
||||
Qt5::Core
|
||||
Qt5::Qml
|
||||
Qt5::Quick
|
||||
Qt5::Svg
|
||||
${foodrescue_EXTRA_LIBS}
|
||||
)
|
||||
|
||||
# What files to install during deploys (the executable and KDE's .desktop file).
|
||||
install(TARGETS foodrescue ${KF5_INSTALL_TARGETS_DEFAULT_ARGS})
|
||||
install(
|
||||
FILES metadata.desktop
|
||||
DESTINATION ${XDG_APPS_INSTALL_DIR}
|
||||
RENAME org.fairdirect.foodrescue.desktop
|
||||
)
|
||||
69
src/android/AndroidManifest.xml
Normal file
69
src/android/AndroidManifest.xml
Normal file
@@ -0,0 +1,69 @@
|
||||
<?xml version="1.0"?>
|
||||
<manifest
|
||||
package="org.fairdirect.foodrescue"
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:versionName="2.3"
|
||||
android:versionCode="7"
|
||||
android:installLocation="auto">
|
||||
|
||||
<application
|
||||
android:hardwareAccelerated="true"
|
||||
android:name="org.qtproject.qt5.android.bindings.QtApplication"
|
||||
android:label="Food Rescue App">
|
||||
|
||||
<activity
|
||||
android:configChanges="orientation|uiMode|screenLayout|screenSize|smallestScreenSize|layoutDirection|locale|fontScale|keyboard|keyboardHidden|navigation"
|
||||
android:name="org.qtproject.qt5.android.bindings.QtActivity"
|
||||
android:label="Food Rescue App"
|
||||
android:theme="@style/AppTheme"
|
||||
android:screenOrientation="unspecified"
|
||||
android:windowSoftInputMode="adjustResize"
|
||||
android:launchMode="singleTop">
|
||||
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN"/>
|
||||
<category android:name="android.intent.category.LAUNCHER"/>
|
||||
</intent-filter>
|
||||
|
||||
<meta-data android:name="android.app.lib_name" android:value="foodrescue"/>
|
||||
<meta-data android:name="android.app.qt_sources_resource_id" android:resource="@array/qt_sources"/>
|
||||
<meta-data android:name="android.app.repository" android:value="default"/>
|
||||
<meta-data android:name="android.app.qt_libs_resource_id" android:resource="@array/qt_libs"/>
|
||||
<meta-data android:name="android.app.bundled_libs_resource_id" android:resource="@array/bundled_libs"/>
|
||||
|
||||
<!-- Deploy Qt libs as part of the package (if requested) -->
|
||||
<meta-data android:name="android.app.bundle_local_qt_libs" android:value="-- %%BUNDLE_LOCAL_QT_LIBS%% --"/>
|
||||
<meta-data android:name="android.app.bundled_in_lib_resource_id" android:resource="@array/bundled_in_lib"/>
|
||||
<meta-data android:name="android.app.bundled_in_assets_resource_id" android:resource="@array/bundled_in_assets"/>
|
||||
|
||||
<!-- Run with local libs -->
|
||||
<meta-data android:name="android.app.use_local_qt_libs" android:value="-- %%USE_LOCAL_QT_LIBS%% --"/>
|
||||
<meta-data android:name="android.app.libs_prefix" android:value="/data/local/tmp/qt/"/>
|
||||
<meta-data android:name="android.app.load_local_libs" android:value="-- %%INSERT_LOCAL_LIBS%% --"/>
|
||||
<meta-data android:name="android.app.load_local_jars" android:value="-- %%INSERT_LOCAL_JARS%% --"/>
|
||||
<meta-data android:name="android.app.static_init_classes" android:value="-- %%INSERT_INIT_CLASSES%% --"/>
|
||||
|
||||
<!-- Messages maps -->
|
||||
<meta-data android:name="android.app.ministro_not_found_msg" android:value="@string/ministro_not_found_msg"/>
|
||||
<meta-data android:name="android.app.ministro_needed_msg" android:value="@string/ministro_needed_msg"/>
|
||||
<meta-data android:name="android.app.fatal_error_msg" android:value="@string/fatal_error_msg"/>
|
||||
|
||||
<!-- Background running -->
|
||||
<!-- Warning: changing this value to true may cause unexpected crashes if the application tries to paint after
|
||||
the "applicationStateChanged(Qt::ApplicationSuspended)" signal was sent. -->
|
||||
<meta-data android:name="android.app.background_running" android:value="false"/>
|
||||
|
||||
<!-- auto screen scale factor -->
|
||||
<meta-data android:name="android.app.auto_screen_scale_factor" android:value="false"/>
|
||||
</activity>
|
||||
</application>
|
||||
|
||||
<uses-sdk android:minSdkVersion="21"/>
|
||||
|
||||
<supports-screens android:largeScreens="true" android:normalScreens="true" android:anyDensity="true" android:smallScreens="true"/>
|
||||
|
||||
<!-- Default features (automatically inserted on deployment based on app dependencies) -->
|
||||
<!-- You can remove this if you do not require the default features. -->
|
||||
<!-- %%INSERT_FEATURES -->
|
||||
|
||||
</manifest>
|
||||
41
src/main.cpp
Normal file
41
src/main.cpp
Normal file
@@ -0,0 +1,41 @@
|
||||
#ifdef Q_OS_ANDROID
|
||||
#include <QGuiApplication>
|
||||
#include <QtAndroid>
|
||||
#else
|
||||
#include <QApplication>
|
||||
#endif
|
||||
|
||||
#include <QQmlApplicationEngine>
|
||||
|
||||
|
||||
int main(int argc, char *argv[]) {
|
||||
QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
|
||||
QCoreApplication::setAttribute(Qt::AA_UseHighDpiPixmaps);
|
||||
|
||||
#ifdef Q_OS_ANDROID
|
||||
QGuiApplication app(argc, argv);
|
||||
#else
|
||||
// Our QuickControls2 style for desktops requires a QApplication.
|
||||
QApplication app(argc, argv);
|
||||
#endif
|
||||
|
||||
QQmlApplicationEngine engine;
|
||||
|
||||
// Use different main files on desktop vs. mobile platform.
|
||||
// FIXME: Switch to the "qrc:/something" URLs if possible. So far not working.
|
||||
const QUrl desktopQML(QStringLiteral("qrc:///qml/BaseApp.qml"));
|
||||
const QUrl mobileQML(QStringLiteral("qrc:///qml/MobileApp.qml"));
|
||||
const bool QQC_MOBILE_SET(qEnvironmentVariableIsSet("QT_QUICK_CONTROLS_MOBILE"));
|
||||
const QString QQC_MOBILE(QString::fromLatin1(qgetenv("QT_QUICK_CONTROLS_MOBILE")));
|
||||
if (QQC_MOBILE_SET && (QQC_MOBILE == QStringLiteral("1") || QQC_MOBILE == QStringLiteral("true"))) {
|
||||
engine.load(mobileQML);
|
||||
} else {
|
||||
engine.load(desktopQML);
|
||||
}
|
||||
|
||||
if (engine.rootObjects().isEmpty()) {
|
||||
QCoreApplication::exit(-1);
|
||||
}
|
||||
|
||||
return app.exec();
|
||||
}
|
||||
24
src/metadata.desktop
Normal file
24
src/metadata.desktop
Normal file
@@ -0,0 +1,24 @@
|
||||
[Desktop Entry]
|
||||
Name=Food Rescue
|
||||
Name[de]=LebensmittelRetter
|
||||
GenericName=Food Rescue Information Browser
|
||||
GenericName[de]=Lebensmittel-Haltbarkeits-Informierer
|
||||
Comment=Helps to assess if food is still edible.
|
||||
Comment[de]=Hilft zu entscheiden, ob Lebensmittel noch essbar sind.
|
||||
|
||||
Type=Application
|
||||
Exec=foodrescue
|
||||
Icon=preferences-desktop-theme
|
||||
Categories=Qt;KDE;
|
||||
|
||||
X-KDE-ParentApp=
|
||||
X-KDE-PluginInfo-Author=Matthias Ansorg
|
||||
X-KDE-PluginInfo-Email=matthias@ansorgs.de
|
||||
X-KDE-PluginInfo-Name=org.fairdirect.foodrescue
|
||||
X-KDE-PluginInfo-Version=0.1
|
||||
X-KDE-PluginInfo-Website=
|
||||
X-KDE-PluginInfo-Category=
|
||||
X-KDE-PluginInfo-Depends=
|
||||
X-KDE-PluginInfo-License=
|
||||
X-KDE-PluginInfo-EnabledByDefault=false
|
||||
X-Plasma-MainScript=
|
||||
33
src/qml/BaseApp.qml
Normal file
33
src/qml/BaseApp.qml
Normal file
@@ -0,0 +1,33 @@
|
||||
import QtQuick 2.1
|
||||
import QtQuick.Controls 2.0 as Controls
|
||||
import QtQuick.Layouts 1.2
|
||||
import org.kde.kirigami 2.4 as Kirigami
|
||||
|
||||
// Content of the main application window.
|
||||
// (Used as-is on desktop. For mobile, wrapped via MobileApp.qml.)
|
||||
Kirigami.ApplicationWindow {
|
||||
id: root
|
||||
|
||||
// Main content area.
|
||||
pageStack.initialPage: mainAreaComponent
|
||||
Component {
|
||||
id: mainAreaComponent
|
||||
MainArea {} // See MainArea.qml.
|
||||
}
|
||||
|
||||
// Left sidebar drawer with the menu.
|
||||
globalDrawer: Kirigami.GlobalDrawer {
|
||||
title: "Global Drawer"
|
||||
titleIcon: "applications-graphics"
|
||||
|
||||
actions: [
|
||||
Kirigami.Action {
|
||||
text: "Menu Entry"
|
||||
icon {
|
||||
name: "configure"
|
||||
color: Kirigami.Theme.activeTextColor
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
41
src/qml/MainArea.qml
Normal file
41
src/qml/MainArea.qml
Normal file
@@ -0,0 +1,41 @@
|
||||
import QtQuick 2.1
|
||||
import QtQuick.Controls 2.0 as QQC2
|
||||
import QtQuick.Layouts 1.2
|
||||
import org.kde.kirigami 2.4 as Kirigami
|
||||
|
||||
Kirigami.ScrollablePage {
|
||||
id: pageRoot
|
||||
|
||||
title: qsTr("Empty App")
|
||||
|
||||
background: Rectangle {
|
||||
color: Kirigami.Theme.backgroundColor
|
||||
}
|
||||
implicitWidth: Kirigami.Units.gridUnit * 12 // Subdivides available for sizing things.
|
||||
|
||||
ListView {
|
||||
id: mainAreaList
|
||||
|
||||
currentIndex: -1 // Don't show any list item as "selected".
|
||||
focus: true
|
||||
|
||||
model: ListModel {
|
||||
ListElement {
|
||||
text: qsTr("List Item 1")
|
||||
}
|
||||
ListElement {
|
||||
text: qsTr("List Item 2")
|
||||
}
|
||||
ListElement {
|
||||
text: qsTr("List Item 3")
|
||||
}
|
||||
}
|
||||
|
||||
delegate: Kirigami.BasicListItem {
|
||||
id: listItem
|
||||
label: model.text
|
||||
highlighted: focus && ListView.isCurrentItem
|
||||
checked: mainAreaList.openPageIndex === index
|
||||
}
|
||||
}
|
||||
}
|
||||
14
src/qml/MobileApp.qml
Normal file
14
src/qml/MobileApp.qml
Normal file
@@ -0,0 +1,14 @@
|
||||
import QtQuick 2.1
|
||||
import QtQuick.Controls 2.0 as Controls
|
||||
import QtQuick.Layouts 1.2
|
||||
import org.kde.kirigami 2.4 as Kirigami
|
||||
|
||||
// Content of the main application window for the mobile version.
|
||||
// (Same for the desktop version in BaseApp.qml, plus an added contextDrawer.)
|
||||
BaseApp {
|
||||
id: root
|
||||
|
||||
contextDrawer: Kirigami.ContextDrawer {
|
||||
id: contextDrawer
|
||||
}
|
||||
}
|
||||
14
src/qtquickcontrols2.conf
Normal file
14
src/qtquickcontrols2.conf
Normal file
@@ -0,0 +1,14 @@
|
||||
[Universal]
|
||||
Primary=#7f6bf3
|
||||
Accent=#7f6bf3
|
||||
Theme=System
|
||||
|
||||
[Material]
|
||||
Primary=#7f6bf3
|
||||
Accent=#7f6bf3
|
||||
Theme=System
|
||||
|
||||
[Default]
|
||||
Primary=#7f6bf3
|
||||
Accent=#7f6bf3
|
||||
Theme=System
|
||||
9
src/resources.qrc
Normal file
9
src/resources.qrc
Normal file
@@ -0,0 +1,9 @@
|
||||
<RCC>
|
||||
<qresource prefix="/">
|
||||
<file>qml/MainArea.qml</file>
|
||||
<file>qml/BaseApp.qml</file>
|
||||
<file>qml/MobileApp.qml</file>
|
||||
<file>qtquickcontrols2.conf</file>
|
||||
<file>metadata.desktop</file>
|
||||
</qresource>
|
||||
</RCC>
|
||||
Reference in New Issue
Block a user