I added class ZConfig: +#include "zypp/ZConfig.h" + + /** Interim helper class to collect global options and settings. + * Use it to avoid hardcoded values and calls to getZypp() just + * to retrieve some value like architecture, languages or tmppath. + */ + class ZConfig + { + public: + /** The system architecture. */ + Arch systemArchitecture() const; + }; Not very impressive by now. - Add methods here instead of hardcoding values (e.g. CacheStore default db location, db filename). - Add methods for values that are required at multiple locations. There's no need to create a ZYpp object just to ask for a tmpPath. We'll see how it evolves. Example: Old parser code: #include "zypp/ZYppFactory.h" static void replace_variables( std::string &text ) { string::size_type pos = text.find("%a"); if (pos != string::npos) { Arch sysarch( getZYpp()->architecture() ); text.replace( pos, 2, sysarch.asString() ); } } would become: #include "zypp/ZConfig.h" static void replace_variables( std::string &text ) { string::size_type pos = text.find("%a"); if (pos != string::npos) { text.replace( pos, 2, ZConfig().systemArchitecture().asString() ); } } If you spot code that calls getZYpp() just to retrieve some setting change it to ZConfig. -- cu, Michael Andres +------------------------------------------------------------------+ Key fingerprint = 2DFA 5D73 18B1 E7EF A862 27AC 3FB8 9E3A 27C6 B0E4 +------------------------------------------------------------------+ Michael Andres YaST Development ma@novell.com SUSE LINUX Products GmbH, GF: Markus Rex, HRB 16746 (AG Nuernberg) Maxfeldstrasse 5, D-90409 Nuernberg, Germany, ++49 (0)911 - 740 53-0 +------------------------------------------------------------------+ -- To unsubscribe, e-mail: zypp-devel+unsubscribe@opensuse.org For additional commands, e-mail: zypp-devel+help@opensuse.org