1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-06 09:07:25 +08:00

Allow Delete and Undelete operations to run silently when needed

This commit is contained in:
Dean Herbert 2019-05-09 15:15:02 +09:00
parent c8f9354327
commit 6ebd13c733

View File

@ -385,7 +385,7 @@ namespace osu.Game.Database
/// Delete multiple items. /// Delete multiple items.
/// This will post notifications tracking progress. /// This will post notifications tracking progress.
/// </summary> /// </summary>
public void Delete(List<TModel> items) public void Delete(List<TModel> items, bool silent = false)
{ {
if (items.Count == 0) return; if (items.Count == 0) return;
@ -396,7 +396,8 @@ namespace osu.Game.Database
State = ProgressNotificationState.Active, State = ProgressNotificationState.Active,
}; };
PostNotification?.Invoke(notification); if (!silent)
PostNotification?.Invoke(notification);
int i = 0; int i = 0;
@ -423,7 +424,7 @@ namespace osu.Game.Database
/// Restore multiple items that were previously deleted. /// Restore multiple items that were previously deleted.
/// This will post notifications tracking progress. /// This will post notifications tracking progress.
/// </summary> /// </summary>
public void Undelete(List<TModel> items) public void Undelete(List<TModel> items, bool silent = false)
{ {
if (!items.Any()) return; if (!items.Any()) return;
@ -434,7 +435,8 @@ namespace osu.Game.Database
State = ProgressNotificationState.Active, State = ProgressNotificationState.Active,
}; };
PostNotification?.Invoke(notification); if (!silent)
PostNotification?.Invoke(notification);
int i = 0; int i = 0;