From d5e2eecf2faacd79cacfc90833f74d22135d5759 Mon Sep 17 00:00:00 2001 From: Jan Kupec Date: Wed, 13 Jun 2007 13:29:49 +0000 Subject: [PATCH] 10.1 compatibility code removed --- src/zypper-callbacks.cc | 6 +++--- src/zypper-callbacks.h | 9 --------- src/zypper-media-callbacks.h | 19 +++++++++++-------- src/zypper-rpm-callbacks.h | 12 ++++++------ src/zypper-source-callbacks.h | 26 +++++++++++++------------- 5 files changed, 33 insertions(+), 39 deletions(-) diff --git a/src/zypper-callbacks.cc b/src/zypper-callbacks.cc index a79bdd2..f77bc70 100644 --- a/src/zypper-callbacks.cc +++ b/src/zypper-callbacks.cc @@ -10,17 +10,17 @@ using namespace std; void display_progress (const string& s, int percent) { static AliveCursor cursor; - cerr_v << CLEARLN << cursor++ << " " << s << "[" << percent << "%]" << flush; + cout_v << CLEARLN << cursor++ << " " << s << "[" << percent << "%]" << flush; } void display_done () { - cerr_v << endl; + cout_v << endl; } //template //Action ... int read_action_ari (int default_action) { - cerr << _("(A)bort, (R)etry, (I)gnore?") << " "; // don't translate letters in parentheses!! + cout << _("(A)bort, (R)etry, (I)gnore?") << " "; // don't translate letters in parentheses!! // non-interactive mode if (gSettings.non_interactive) { diff --git a/src/zypper-callbacks.h b/src/zypper-callbacks.h index 907d084..7f92a87 100644 --- a/src/zypper-callbacks.h +++ b/src/zypper-callbacks.h @@ -13,15 +13,6 @@ #include #include -// trying to compile for 10.1 where the callbacks had different signatures -#ifdef LIBZYPP_1xx -typedef std::string cbstring; -typedef zypp::Url cbUrl; -#else -typedef const std::string& cbstring; -typedef const zypp::Url& cbUrl; -#endif - /* enum Error { NO_ERROR, diff --git a/src/zypper-media-callbacks.h b/src/zypper-media-callbacks.h index 864ede0..e108aaa 100644 --- a/src/zypper-media-callbacks.h +++ b/src/zypper-media-callbacks.h @@ -13,6 +13,8 @@ #include #include +#include + #include #include #include @@ -32,7 +34,7 @@ namespace ZmartRecipients struct MediaChangeReportReceiver : public zypp::callback::ReceiveReport { - virtual MediaChangeReport::Action requestMedia( zypp::Source_Ref source, unsigned mediumNr, MediaChangeReport::Error error, cbstring description ) + virtual MediaChangeReport::Action requestMedia( zypp::Source_Ref source, unsigned mediumNr, MediaChangeReport::Error error, const std::string & description ) { cout << "Please insert media [" << description << "] # " << mediumNr << ". Retry [y/n]: " << endl; if (readBoolAnswer()) @@ -46,32 +48,33 @@ namespace ZmartRecipients // progress for downloading a file struct DownloadProgressReportReceiver : public zypp::callback::ReceiveReport { - virtual void start( cbUrl file, zypp::Pathname localfile ) + virtual void start( const zypp::Url & file, zypp::Pathname localfile ) { - cerr_v << "Downloading: " - << file << " to " << localfile << std::endl; + cout_v << CLEARLN << _("Downloading: ") << file; + cout_vv << " to " << localfile; + cout_v << std::endl; } - virtual bool progress(int value, cbUrl /*file*/) + virtual bool progress(int value, const zypp::Url & /*file*/) { display_progress ("Downloading", value); return true; } - virtual DownloadProgressReport::Action problem( cbUrl /*file*/, DownloadProgressReport::Error error, cbstring description ) + virtual DownloadProgressReport::Action problem( const zypp::Url & /*file*/, DownloadProgressReport::Error error, const std::string & description ) { display_done (); display_error (error, description); return DownloadProgressReport::ABORT; } - virtual void finish( cbUrl /*file*/, Error error, cbstring konreason ) + virtual void finish( const zypp::Url & /*file*/, Error error, const std::string & konreason ) { display_done (); display_error (error, konreason); } }; - + /////////////////////////////////////////////////////////////////// }; // namespace ZmartRecipients /////////////////////////////////////////////////////////////////// diff --git a/src/zypper-rpm-callbacks.h b/src/zypper-rpm-callbacks.h index b2ed6d4..67e8ba1 100644 --- a/src/zypper-rpm-callbacks.h +++ b/src/zypper-rpm-callbacks.h @@ -111,12 +111,12 @@ struct ScanRpmDbReceive : public zypp::callback::ReceiveReport { - virtual void start( zypp::Source_Ref source, cbstring task ) + virtual void start( zypp::Source_Ref source, const std::string & task ) { _task = task; _source = source; @@ -225,14 +225,14 @@ struct SourceReportReceiver : public zypp::callback::ReceiveReport