summaryrefslogtreecommitdiffstats
path: root/examples/applicationmanager/custom-appman/custom-appman.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Refactor the representation of the YAML configurationRobert Griebl2024-05-291-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a bit of a kitchen sink commit for a lot of things touching the YAML parsing code. Splitting it up would have been a nightmare though and touched a lot of code lines multiple times. - Adding a new field to the YAML confguration was quite involved: 1) add it to the parser in loadFromSource() 2) add it to loadFromCache() 3) add it to saveToCache() (same order as in step 2) 4) add it to merge() 5) bump dataStreamVersion() 6) add one or more public getter function(s) to Configuration, depending on the complexity of the data-type. In order to get around this problem, a lot of fields just used an un-typed QVariantMap. This patch eliminates step 3) and 6) loadFromCache() and saveToCache() now use a common serialize() function and some template magic to do both tasks. - The YAML file is now mostly resembled by a publicly accessible nested struct of structs: this makes the code (a) more readable (as the C++ code matches the YAML structure) and (b) does away with the gazillions of getters. - This was also the perfect time to finally use a real data structure for the OpenGL config, replacing the QVariantMap hack. - While at it, the actual field parsing was made a lot more readble: - got rid of the unnecessary YamlParse* lambda arguments - added helper parseFoo() functions to make code more concise - used the same parseFields(<temp list>) syntax everywhere - added specialized parsing for time duration values Change-Id: Ia811056f7220bf7509af146f69f99c6f7e4b09ea Reviewed-by: Dominik Holland <dominik.holland@qt.io>
* Fix exception handling after Q*Application::exec()Robert Griebl2024-03-071-8/+11
| | | | | | | | | | | | | | | | Uncaught exceptions thrown after we call exec() are originating from user code and we should not be catching those in our top-level catch handler. This will just print "ERROR: <what()>" without any context and make it look like the error is coming from the AM itself. Instead we need to run the event loop without a try/catch handler, so stray exception from user code go directly to our set_terminate handler in the CrashHandler class, which preserves as much context as possible and prints out a lot more useful meta data for debugging. Change-Id: Icc0432d5a6c5db85de439cafab89d05aa88b5891 Pick-to: 6.7 6.6 6.5 Reviewed-by: Dominik Holland <dominik.holland@qt.io>
* Modernize string literalsRobert Griebl2024-01-081-2/+4
| | | | | | | | | Replace all our custom qSL/qL1S/qL1C macros with standard C++ and QString unicode string literals. Change-Id: I9e0b69fb46525421f408f260518a69b8f8125d99 Pick-to: 6.7 Reviewed-by: Dominik Holland <dominik.holland@qt.io>
* Simplify custom appman implementationsRobert Griebl2023-12-061-10/+13
| | | | | | | | | | - all necessary steps that had to occur in user code before the Main c'tor are now done implicitly via a preConstructor function in Main - a QT_AM_MAIN() macro was added which will be used to actually compile our examples in an upcoming commit Change-Id: I9a3b3eb7dd54702f3c797ee3d58f55a6067d9466 Reviewed-by: Dominik Holland <dominik.holland@qt.io>
* Make Sudo universally available for all buildsRobert Griebl2023-11-271-1/+0
| | | | | | | | | | | This way we do not have to guard all locations where sudo.h is included. Also fix missing or superfluous includes. Change-Id: Icbf7133662fa49a037322cd49b843f14fe7e16a4 Pick-to: 6.6 6.5 6.2 Reviewed-by: Dominik Holland <dominik.holland@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Use SPDX license identifiersDominik Holland2022-06-151-51/+4
| | | | | | | | | | | | Replace the current license disclaimer in files by a SPDX-License-Identifier. Files that have to be modified by hand are modified. License files are organized under LICENSES directory. Pick-to: 6.4 Task-number: QTBUG-67283 Change-Id: I09660e42dea769d720ff30e652485d9861cea965 Reviewed-by: Robert Griebl <robert.griebl@qt.io>
* Clazy: fix examplesRobert Griebl2021-08-171-2/+2
| | | | | | | Also replaced qSL/qL1S with the original, non-macro versions. Change-Id: Ied8f4e8ee750ce0f6b7bf7e7800608c2b39c71d1 Reviewed-by: Dominik Holland <dominik.holland@qt.io>
* Update copyright headers to 2021 an finally switch to the GPLRobert Griebl2021-06-011-11/+9
| | | | | | | | | Also removed all the SPDX tags and -QTAS license extensions. Change-Id: Ibd10fe37afcbba832831d027cf2f1891ca0226c0 Fixes: AUTOSUITE-1648 Fixes: AUTOSUITE-1646 Reviewed-by: Dominik Holland <dominik.holland@qt.io>
* Fix lists not being merged when using multiple config filesRobert Griebl2020-09-241-1/+1
| | | | | | | | | Also adds a complete auto-test to not only test the generic, low-level YAML parsing and merging, but also the concrete implementation in Configuration. Change-Id: Idd7057af39423a57aa7b5100b41cb7c34a0da336 Task-number: AUTOSUITE-1620 Reviewed-by: Bernd Weimer <bernd.weimer@pelagicore.com>
* Small fixes - mostly qdoc warningsRobert Griebl2020-07-171-1/+1
| | | | | Change-Id: I86926f03e616aeefd680dd9650eb551eb335f4fb Reviewed-by: Bernd Weimer <bernd.weimer@pelagicore.com>
* Do the necessary changes to the locale on startup implicitlyRobert Griebl2020-02-031-1/+0
| | | | | | | | | | Instead of requiring the boilerplate setup call to be copied into each and every system-ui, we do the setup now implicitly in the Main constructor. (Calling it explicitly beforehand doesn't hurt though) Change-Id: I549288397d397330af1733f8982666c54b4724cd Reviewed-by: Dominik Holland <dominik.holland@qt.io>
* Fully transparent and generic cache for config and app databaseRobert Griebl2019-11-071-2/+3
| | | | | | | | | | The existing caching mechanism for config files was abstracted and extended, so that it could be re-used to parse and cache the info.yaml files. This results in a much more robust application database and should get rid of 99.9% of all the -r/--recreate-database option usages. Change-Id: Ic37fcd3b0e55d481712d469b6e331b9c433a9c5d Reviewed-by: Dominik Holland <dominik.holland@qt.io>
* Rename from Luxoft AM to Qt AMRobert Griebl2019-08-051-1/+1
| | | | | | Change-Id: I84bbd9e7f735ed1864804a9887d3a02b7c925e53 Reviewed-by: Vladimir Minenko <vladimir.minenko@pelagicore.com> Reviewed-by: Bernd Weimer <bernd.weimer@pelagicore.com>
* (Re)implement package and application blockingRobert Griebl2019-08-021-1/+1
| | | | | | | | | | | This was deliberately left out of the first patch that introduced the package abstraction. As a side effect, the classes from the installer-lib had to be moved to the manager-lib, because the PackageManager is now a central part of the AM, that has to have access to other classes in the manager-lib. Change-Id: I94c1e62d3ffa769f3e053aab8730fea9133a7bc8 Reviewed-by: Dominik Holland <dominik.holland@pelagicore.com>
* Add new package abstraction, which allows multiple executables per packageRobert Griebl2019-08-011-2/+2
| | | | | | | | This is part 1 which is missing doc updates and missing the update-builtin- applications functionality. Both will be added in a follow-up commit. Change-Id: I2b493cfb7585143962067674690b02cc132ef78b Reviewed-by: Dominik Holland <dominik.holland@pelagicore.com>
* Fix application naming for --help and --versionRobert Griebl2019-06-251-1/+1
| | | | | Change-Id: I861bd4167d8676c36e8f40c9acd35b17436ac6ff Reviewed-by: Dominik Holland <dominik.holland@pelagicore.com>
* Fixing more UTF-8 problems on macOS: runtime errors in libarchiveRobert Griebl2019-01-161-5/+2
| | | | | | | | | | | | | | | | When running auto-tests or appman tools in a shell with LC_CTYPE/LC_ALL not being set or being set to a non-UTF-8 value, libarchive will not be able to read a from an archive with UTF-8 encoded names. We're now using the same code path as on Linux to detect and workaround these situations. In addition, a DeploymentWarning is generated if the default locale is not suitable. (also needed to fix the custom appman example and its docs) Change-Id: Ib2936fafead518a66efffc2e7bedceb7c46836d3 Reviewed-by: Dominik Holland <dominik.holland@pelagicore.com>
* Update copyright statementsRobert Griebl2018-12-181-1/+2
| | | | | | | | - added 2019 - everything is (c) Luxoft instead of Pelagicore from now on Change-Id: I82f874f0b0601deae1bb39347821edaf3c4cc6d8 Reviewed-by: Dominik Holland <dominik.holland@pelagicore.com>
* Fix installation of the examplesDaniel d'Andrada2018-07-111-0/+90
- Only the project files and wrapper scripts were being installed - They were being put directly into Qt's example dir. They should be grouped into a applicationmanager subdirectory there, similarly to what other modules do. Task-number: AUTOSUITE-591 Change-Id: I1da6b28a8fe2e9210ad109309d30dfc1ad0d1e99 Reviewed-by: Robert Griebl <robert.griebl@pelagicore.com>