On Tuesday 05 June 2012 21:19:11 Saurabh Sood wrote:
Hi, I implemented the callbacks, but I could not get how the connection to the callbacks will be made. I want the GPG keys to be imported whenever the repository is to be added. I have so far instantiated the class, which uses the struct for KeyRingReport.
http://doc.opensuse.org/projects/libzypp/HEAD/namespacezypp_1_1callback.html Those callbacks are simple one-to-one connections. You can e.g. call connect() in the ctor. Then create a variable with appropriate scope. struct KeyRingSignalsReceive : public callback::ReceiveReport<KeyRingSignals> { KeyRingSignalsReceive() { connect(); } ... }; ... KeyRingSignalsReceive keyRingSignalsReceiver; See also: http://doc.opensuse.org/projects/libzypp/HEAD/classzypp_1_1KeyRing.html 'enum DefaultAcceptBits' and 'KeyRing::setDefaultAccept'. Callback is interesting if you want to give feedback. You can also set a desired default without need to use callbacks: KeyRing::setDefaultAccept( KeyRing::ACCEPT_UNKNOWNKEY | KeyRing::TRUST_KEY_TEMPORARILY ); -- cu, Michael Andres +------------------------------------------------------------------+ Key fingerprint = 2DFA 5D73 18B1 E7EF A862 27AC 3FB8 9E3A 27C6 B0E4 +------------------------------------------------------------------+ Michael Andres SUSE LINUX Products GmbH, Development, ma@suse.de GF:Jeff Hawn,Jennifer Guild,Felix Imendörffer, HRB16746(AG Nürnberg) Maxfeldstrasse 5, D-90409 Nuernberg, Germany, ++49 (0)911 - 740 53-0 +------------------------------------------------------------------+ -- To unsubscribe, e-mail: zypp-devel+unsubscribe@opensuse.org To contact the owner, e-mail: zypp-devel+owner@opensuse.org