Summary: | Info on how to get started using KPMcore library is incomplete | ||
---|---|---|---|
Product: | [Applications] partitionmanager | Reporter: | Ross Boylan <Ross.Boylan> |
Component: | general | Assignee: | Andrius Štikonas <andrius> |
Status: | REPORTED --- | ||
Severity: | normal | ||
Priority: | NOR | ||
Version First Reported In: | Git | ||
Target Milestone: | --- | ||
Platform: | Debian stable | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | ||
Sentry Crash Report: |
Description
Ross Boylan
2022-12-03 20:08:43 UTC
Also, I would expect there to be some master include file, e.g., `#include <KPMcore>` that would get the whole library. It is unclear if such a file exists, or what it's called. Yes, documentation needs more work... This is due to how kpmcore appeared. Initially we had just partitionmanager as application with no library, later Calamares installer started using forked version of partitionmanager but later we managed to separate some bits into a separate library, so that Calamares installer can link to those. Those bits of kpmcore that were useful to Calamares were separated into library but the coupling between application and library is fairly tight and API is not particularly nice. Have you checked kpmcore/test directory. In particular testlist.cpp should be a fairly self contained example how to get the list of device objects and print some of that info. Thanks for the pointer. That was the last bit I needed, and I can now compile and run. Qt structures are impenetrable in the debugger, but that's a separate issue. I'm installing kdevelop and qtcreator now; I think both have helpers for debugging. So my final tips to get running were 1. Use CoreBackendManager::self()->backend() to get the backend. 2. The app requires the Qt event loop, which can be started with QCoreApplication app(argc, argv); 3. Those require including <backend/corebackend.h> and <QCoreApplication> By the way, continuing on your remarks that kpmcore isn't a regular library, when I went to file a bug I noticed there was no entry for it under KDE Frameworks; there is one for partitionmanager under Applications. This might also be related to why no API documentation appears on the web. (In reply to Ross Boylan from comment #3) > Thanks for the pointer. That was the last bit I needed, and I can now > compile and run. Qt structures are impenetrable in the debugger, but that's > a separate issue. I'm installing kdevelop and qtcreator now; I think both > have helpers for debugging. > > So my final tips to get running were > 1. Use CoreBackendManager::self()->backend() to get the backend. > 2. The app requires the Qt event loop, which can be started with > QCoreApplication app(argc, argv); > 3. Those require including <backend/corebackend.h> and <QCoreApplication> Maybe I can convince you to update README with the things you discovered? (Or at least mention this useful example in tests directory). |