Mailinglist Archive: zypp-devel (56 mails)
| < Previous | Next > |
[zypp-devel] zypp::ProgressData question
- From: Ladislav Slezak <lslezak@xxxxxxx>
- Date: Tue, 04 Dec 2007 17:54:04 +0100
- Message-id: <4755862C.4010304@xxxxxxx>
Hello all,
I'm improving callback implementation in pkg-bindings,
I'd like to add a total progress and the callbacks should be displayed
in the main dialog (instead of popups).
I'm reusing zypp::ProgressData class with zypp::CombinedProgressData class which
provides a sub progress for a sub task. That's nice.
But I have a problem, I can register only
bool function(const zypp::ProgressData&)
as the receiver function, I'd like to register
bool MyClass::function(const zypp::ProgressData&)
Is it possible somehow? Maybe I'm not using the classes correctly...
Currently I'm using this really ugly hack (a global pointer):
PkgModuleFunctions *ptr = NULL;
bool source_receiver(const zypp::ProgressData &progress)
{
if (ptr != NULL)
{
return ptr->SourceLoadReceiver(progress);
}
return true;
}
bool PkgModuleFunctions::SourceLoadReceiver(const zypp::ProgressData &progress)
{
// handle the progress here...
}
YCPValue PkgModuleFunctions::SourceLoad()
{
ptr = this;
YCPValue ret = SourceLoadImpl(source_receiver);
// ^^^^^^^^^^^^^^^^^^
// here I'd like to use PkgModuleFunctions::SourceLoadReceiver
return ret;
}
PkgModuleFunctions::SourceLoadReceiver doesn't work for this reason:
Source.cc: In member function 'YCPValue PkgModuleFunctions::SourceLoad()':
Source.cc:442: error: no matching function for call to
'PkgModuleFunctions::SourceLoadImpl(<unresolved overloaded function type>)'
./PkgModuleFunctions.h:180: note: candidates are: YCPValue
PkgModuleFunctions::SourceLoadImpl(const boost::function<bool ()(const
zypp::ProgressData&), std::allocator<void> >&)
See the latest SVN version of pkg-bindings for more details...
Thank you in advance
--
Best Regards
Ladislav Slezák
Yast Developer
------------------------------------------------------------------------
SUSE LINUX, s.r.o. e-mail: lslezak@xxxxxxx
Lihovarská 1060/12 tel: +420 284 028 960
190 00 Prague 9 fax: +420 284 028 951
Czech Republic http://www.suse.cz/
--
To unsubscribe, e-mail: zypp-devel+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: zypp-devel+help@xxxxxxxxxxxx
| < Previous | Next > |