MCPcopy Create free account
hub / github.com/SpartanJ/eepp / discard

Method discard

src/tools/ecode/plugins/git/gitplugin.cpp:1039–1056  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1037}
1038
1039void GitPlugin::discard( const std::vector<std::string>& files ) {
1040 UIMessageBox* msgBox = UIMessageBox::New(
1041 UIMessageBox::OK_CANCEL,
1042 i18n( "git_confirm_discard_changes", "Are you sure you want to discard all file changes?" )
1043 .toUtf8() );
1044
1045 msgBox->on( Event::OnConfirm, [this, files]( auto ) {
1046 runAsync(
1047 [this, files]() {
1048 return mGit->restore( fixFilePaths( files ), mGit->repoPath( files[0] ) );
1049 },
1050 true, true );
1051 } );
1052 msgBox->setCloseShortcut( { KEY_ESCAPE, KEYMOD_NONE } );
1053 msgBox->setTitle( i18n( "git_confirm", "Confirm" ) );
1054 msgBox->center();
1055 msgBox->showWhenReady();
1056}
1057
1058void GitPlugin::discard( const std::string& file ) {
1059 UIMessageBox* msgBox = UIMessageBox::New(

Callers

nothing calls this directly

Calls 10

formatFunction · 0.85
toUtf8Method · 0.80
centerMethod · 0.80
showWhenReadyMethod · 0.80
NewFunction · 0.50
onMethod · 0.45
restoreMethod · 0.45
repoPathMethod · 0.45
setCloseShortcutMethod · 0.45
setTitleMethod · 0.45

Tested by

no test coverage detected