Opened 2 years ago

Last modified 2 years ago

#13112 assigned bug

BPackageKit's BContext needs to be more user friendly

Reported by: kallisti5 Owned by: nobody
Priority: high Milestone: Unscheduled
Component: Kits/Package Kit Version: R1/Development
Keywords: Cc:
Blocked By: Blocking:
Has a Patch: no Platform: All

Description

BPackageKit has a huge number of set-up requirements that may not be relevant in a lot of use cases.

http://cgit.haiku-os.org/haiku/tree/src/bin/pkgman/command_refresh.cpp#n45

For example, to refresh the repositories, I need to create a BContext which is made up of a custom DecisionProvider class and a JobStateListener class.

To have BDecisionProvider simply accept all changes, I have to write a silly class as follows:

class DummyDescision : public BDecisionProvider {
public:
                             DummyDescision();
                            ~DummyDescision();
            bool             YesNoDescisionNeeded(const BString& description,
                               const BString& question, const BString& yes,
                               const BString& no, const BString& defChoice)
                                   { return true; }
}

JobStateListener is even worse: http://cgit.haiku-os.org/haiku/tree/src/bin/pkgman/JobStateListener.cpp

Ideally I should be able to construct a BDescisionProvider and a BJobStateListener with sane defaults (accept all changes, etc)

Why are these API's so infinitely complex?

Change History (1)

comment:1 Changed 2 years ago by bonefish

Owner: changed from bonefish to nobody
Status: newassigned
Note: See TracTickets for help on using tickets.