From 1ad45b094178dc644ffcbc3ca808a2cb1c4ad0ac Mon Sep 17 00:00:00 2001 From: naoey Date: Mon, 26 Feb 2018 01:16:46 +0530 Subject: [PATCH] R# fixes. --- .../GetUserRecentActivitiesRequest.cs | 4 ---- .../Sections/Recent/DrawableRecentActivity.cs | 19 +++++-------------- .../PaginatedRecentActivityContainer.cs | 11 +++-------- .../Profile/Sections/RecentSection.cs | 2 ++ osu.Game/Overlays/UserProfileOverlay.cs | 2 +- 5 files changed, 11 insertions(+), 27 deletions(-) diff --git a/osu.Game/Online/API/Requests/GetUserRecentActivitiesRequest.cs b/osu.Game/Online/API/Requests/GetUserRecentActivitiesRequest.cs index 14997b070b..d52d0c884e 100644 --- a/osu.Game/Online/API/Requests/GetUserRecentActivitiesRequest.cs +++ b/osu.Game/Online/API/Requests/GetUserRecentActivitiesRequest.cs @@ -3,10 +3,6 @@ using osu.Game.Rulesets.Scoring; using Humanizer; using System; using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using osu.Game.Rulesets; namespace osu.Game.Online.API.Requests { diff --git a/osu.Game/Overlays/Profile/Sections/Recent/DrawableRecentActivity.cs b/osu.Game/Overlays/Profile/Sections/Recent/DrawableRecentActivity.cs index 4d215467bb..940cd7f5ac 100644 --- a/osu.Game/Overlays/Profile/Sections/Recent/DrawableRecentActivity.cs +++ b/osu.Game/Overlays/Profile/Sections/Recent/DrawableRecentActivity.cs @@ -1,9 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using osu.Framework.Allocation; +using osu.Framework.Allocation; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Game.Graphics; @@ -13,26 +8,22 @@ using osu.Game.Online.API; using osu.Game.Online.API.Requests; using osu.Game.Online.Chat; using osu.Game.Screens.Select.Leaderboards; -using osu.Game.Users; -using static osu.Game.Online.API.Requests.RecentActivity; namespace osu.Game.Overlays.Profile.Sections.Recent { public class DrawableRecentActivity : DrawableProfileRow { - private RecentActivity activity; - private User user; private APIAccess api; - private string userLinkTemplate; - private string beatmapLinkTemplate; + private readonly RecentActivity activity; + private readonly string userLinkTemplate; + private readonly string beatmapLinkTemplate; private LinkFlowContainer content; - public DrawableRecentActivity(RecentActivity activity, User user) + public DrawableRecentActivity(RecentActivity activity) { this.activity = activity; - this.user = user; userLinkTemplate = $"[{urlToAbsolute(activity.User?.Url)} {activity.User?.Username}]"; beatmapLinkTemplate = $"[{urlToAbsolute(activity.Beatmap?.Url)} {activity.Beatmap?.Title}]"; diff --git a/osu.Game/Overlays/Profile/Sections/Recent/PaginatedRecentActivityContainer.cs b/osu.Game/Overlays/Profile/Sections/Recent/PaginatedRecentActivityContainer.cs index 307c06b744..f1857096aa 100644 --- a/osu.Game/Overlays/Profile/Sections/Recent/PaginatedRecentActivityContainer.cs +++ b/osu.Game/Overlays/Profile/Sections/Recent/PaginatedRecentActivityContainer.cs @@ -1,17 +1,12 @@ using osu.Framework.Configuration; using osu.Framework.Graphics; using osu.Game.Online.API.Requests; -using osu.Game.Overlays.Profile.Sections.Recent; using osu.Game.Users; -using System; -using System.Collections.Generic; using System.Linq; -using System.Text; -using System.Threading.Tasks; -namespace osu.Game.Overlays.Profile.Sections +namespace osu.Game.Overlays.Profile.Sections.Recent { - class PaginatedRecentActivityContainer : PaginatedContainer + internal class PaginatedRecentActivityContainer : PaginatedContainer { public PaginatedRecentActivityContainer(Bindable user, string header, string missing) : base(user, header, missing) @@ -40,7 +35,7 @@ namespace osu.Game.Overlays.Profile.Sections foreach (RecentActivity activity in activities) { - ItemsContainer.Add(new DrawableRecentActivity(activity, User)); + ItemsContainer.Add(new DrawableRecentActivity(activity)); } }; diff --git a/osu.Game/Overlays/Profile/Sections/RecentSection.cs b/osu.Game/Overlays/Profile/Sections/RecentSection.cs index 757e2457d2..db97dca440 100644 --- a/osu.Game/Overlays/Profile/Sections/RecentSection.cs +++ b/osu.Game/Overlays/Profile/Sections/RecentSection.cs @@ -1,6 +1,8 @@ // Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE +using osu.Game.Overlays.Profile.Sections.Recent; + namespace osu.Game.Overlays.Profile.Sections { public class RecentSection : ProfileSection diff --git a/osu.Game/Overlays/UserProfileOverlay.cs b/osu.Game/Overlays/UserProfileOverlay.cs index f19fc4062c..f3fd7aeac5 100644 --- a/osu.Game/Overlays/UserProfileOverlay.cs +++ b/osu.Game/Overlays/UserProfileOverlay.cs @@ -78,7 +78,7 @@ namespace osu.Game.Overlays if (userId == Header.User.Id) return; - ShowUser(new User { Id = userId }, true); + ShowUser(new User { Id = userId }); } public void ShowUser(User user, bool fetchOnline = true)