Skip to content

Commit

Permalink
Merge pull request #119 from mlandres/Drop_ConvertDBReport
Browse files Browse the repository at this point in the history
Remove legacy zypp::target::rpm::ConvertDBReport
  • Loading branch information
lslezak committed Feb 18, 2020
2 parents bc936b1 + 7e399b5 commit f1e1f89
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 57 deletions.
2 changes: 1 addition & 1 deletion src/Callbacks.YCP.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ class PkgFunctions::CallbackHandler::YCPCallbacks
**/
enum CBid {
CB_StartRebuildDb, CB_ProgressRebuildDb, CB_NotifyRebuildDb, CB_StopRebuildDb,
CB_StartConvertDb, CB_ProgressConvertDb, CB_NotifyConvertDb, CB_StopConvertDb,
/* Legacy: Unused since Code12 */ CB_StartConvertDb, CB_ProgressConvertDb, CB_NotifyConvertDb, CB_StopConvertDb,
CB_StartScanDb, CB_ProgressScanDb, CB_ErrorScanDb, CB_DoneScanDb,
CB_StartProvide, CB_ProgressProvide, CB_DoneProvide,
CB_StartPackage, CB_ProgressPackage, CB_DonePackage,
Expand Down
55 changes: 0 additions & 55 deletions src/Callbacks.cc
Original file line number Diff line number Diff line change
Expand Up @@ -94,57 +94,6 @@ namespace ZyppRecipients {
};


///////////////////////////////////////////////////////////////////
// ConvertDbCallback
///////////////////////////////////////////////////////////////////
struct ConvertDbReceive : public Recipient, public zypp::callback::ReceiveReport<zypp::target::rpm::ConvertDBReport>
{
ConvertDbReceive( RecipientCtl & construct_r ) : Recipient( construct_r ) {}

virtual void reportbegin()
{
y2milestone("Convert DB Init Callback");
}

virtual void reportend()
{
y2milestone("Convert DB Destroy Callback");
}

virtual void start(zypp::Pathname pname) {
CB callback(ycpcb(YCPCallbacks::CB_StartConvertDb));
if (callback._set) {
callback.addStr(pname.asString());
callback.evaluate();
}
}

virtual bool progress(int value, zypp::Pathname pth)
{
CB callback( ycpcb( YCPCallbacks::CB_ProgressConvertDb ) );
if (callback._set) {
callback.addInt( value );
callback.addStr(pth.asString());
callback.evaluate();
}

// return default value from the parent class
return zypp::target::rpm::ConvertDBReport::progress(value, pth);
}

virtual void finish(zypp::Pathname path, zypp::target::rpm::ConvertDBReport::Error error, const std::string &reason)
{
CB callback( ycpcb( YCPCallbacks::CB_StopConvertDb ) );
if (callback._set) {
callback.addInt( error );
callback.addStr( reason );
callback.evaluate();
}
}
};



///////////////////////////////////////////////////////////////////
// RebuildDbCallback
///////////////////////////////////////////////////////////////////
Expand Down Expand Up @@ -1845,7 +1794,6 @@ class PkgFunctions::CallbackHandler::ZyppReceive : public ZyppRecipients::Recipi
private:

// RRM DB callbacks
ZyppRecipients::ConvertDbReceive _convertDbReceive;
ZyppRecipients::RebuildDbReceive _rebuildDbReceive;

// package callbacks
Expand Down Expand Up @@ -1885,7 +1833,6 @@ class PkgFunctions::CallbackHandler::ZyppReceive : public ZyppRecipients::Recipi

ZyppReceive( const YCPCallbacks & ycpcb_r, PkgFunctions &pkg)
: RecipientCtl( ycpcb_r )
, _convertDbReceive( *this )
, _rebuildDbReceive( *this )
, _installPkgReceive( *this, pkg )
, _removePkgReceive( *this )
Expand All @@ -1905,7 +1852,6 @@ class PkgFunctions::CallbackHandler::ZyppReceive : public ZyppRecipients::Recipi
, _authReceive( *this )
{
// connect the receivers
_convertDbReceive.connect();
_rebuildDbReceive.connect();
_installPkgReceive.connect();
_removePkgReceive.connect();
Expand All @@ -1928,7 +1874,6 @@ class PkgFunctions::CallbackHandler::ZyppReceive : public ZyppRecipients::Recipi
virtual ~ZyppReceive()
{
// disconnect the receivers
_convertDbReceive.disconnect();
_rebuildDbReceive.disconnect();
_installPkgReceive.disconnect();
_removePkgReceive.disconnect();
Expand Down
5 changes: 4 additions & 1 deletion src/Callbacks_Register.cc
Original file line number Diff line number Diff line change
Expand Up @@ -226,16 +226,19 @@ YCPValue PkgFunctions::CallbackDoneScanDb( const YCPValue& args ) {
return SET_YCP_CB( CB_DoneScanDb, args );
}


/** Legacy: Unused since Code12 */
YCPValue PkgFunctions::CallbackStartConvertDb( const YCPValue& args ) {
return SET_YCP_CB( CB_StartConvertDb, args );
}
/** Legacy: Unused since Code12 */
YCPValue PkgFunctions::CallbackProgressConvertDb( const YCPValue& args ) {
return SET_YCP_CB( CB_ProgressConvertDb, args );
}
/** Legacy: Unused since Code12 */
YCPValue PkgFunctions::CallbackNotifyConvertDb( const YCPValue& args ) {
return SET_YCP_CB( CB_NotifyConvertDb, args );
}
/** Legacy: Unused since Code12 */
YCPValue PkgFunctions::CallbackStopConvertDb( const YCPValue& args ) {
return SET_YCP_CB( CB_StopConvertDb, args );
}
Expand Down

0 comments on commit f1e1f89

Please sign in to comment.