Skip to content

Commit 473a92f

Browse files
authored
Remove creator function and replace with HAL include (#926)
* Remove creator function and replace with HAL include * Add IOS and Mac files for user * Add file to snapshots * Add additional files * Fix test * Correct test to use shareable
1 parent f8ec9c5 commit 473a92f

File tree

10 files changed

+24
-17
lines changed

10 files changed

+24
-17
lines changed

plugin-dev/Source/Sentry/Private/HAL/PlatformSentryUser.h

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,4 @@
22

33
#pragma once
44

5-
#if PLATFORM_ANDROID
6-
#include "Android/AndroidSentryUser.h"
7-
#elif PLATFORM_APPLE
8-
#include "Apple/AppleSentryUser.h"
9-
#elif USE_SENTRY_NATIVE
10-
#include "GenericPlatform/GenericPlatformSentryUser.h"
11-
#else
12-
#include "Null/NullSentryUser.h"
13-
#endif
14-
15-
static TSharedPtr<ISentryUser> CreateSharedSentryUser()
16-
{
17-
return MakeShareable(new FPlatformSentryUser);
18-
}
5+
#include COMPILED_PLATFORM_HEADER(SentryUser.h)
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#pragma once
2+
3+
#include "Apple/AppleSentryUser.h"
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#pragma once
2+
3+
#include "GenericPlatform/GenericPlatformSentryUser.h"
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#pragma once
2+
3+
#include "Apple/AppleSentryUser.h"

plugin-dev/Source/Sentry/Private/SentryLibrary.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ USentryEvent* USentryLibrary::CreateSentryEvent(const FString& Message, ESentryL
2929

3030
USentryUser* USentryLibrary::CreateSentryUser(const FString& Email, const FString& Id, const FString& Username, const FString& IpAddress, const TMap<FString, FString>& Data)
3131
{
32-
USentryUser* User = USentryUser::Create(CreateSharedSentryUser());
32+
USentryUser* User = USentryUser::Create(MakeShareable(new FPlatformSentryUser));
3333

3434
if (!Email.IsEmpty())
3535
User->SetEmail(Email);

plugin-dev/Source/Sentry/Private/SentryUser.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
void USentryUser::Initialize()
88
{
9-
NativeImpl = CreateSharedSentryUser();
9+
NativeImpl = MakeShareable(new FPlatformSentryUser);
1010
}
1111

1212
void USentryUser::SetEmail(const FString& Email)

plugin-dev/Source/Sentry/Private/Tests/SentryUser.spec.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ void SentryUserSpec::Define()
1717
{
1818
BeforeEach([this]()
1919
{
20-
SentryUser = USentryUser::Create(CreateSharedSentryUser());
20+
SentryUser = USentryUser::Create(MakeShareable(new FPlatformSentryUser));
2121
});
2222

2323
Describe("User params", [this]()
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#pragma once
2+
3+
#include "GenericPlatform/GenericPlatformSentryUser.h"

scripts/packaging/package-github.snapshot

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,10 +130,13 @@ Source/Sentry/Private/Interface/SentryUserFeedbackInterface.h
130130
Source/Sentry/Private/Interface/SentryUserInterface.h
131131
Source/Sentry/Private/IOS/IOSSentrySubsystem.cpp
132132
Source/Sentry/Private/IOS/IOSSentrySubsystem.h
133+
Source/Sentry/Private/IOS/IOSSentryUser.h
133134
Source/Sentry/Private/Linux/LinuxSentrySubsystem.cpp
134135
Source/Sentry/Private/Linux/LinuxSentrySubsystem.h
136+
Source/Sentry/Private/Linux/LinuxSentryUser.h
135137
Source/Sentry/Private/Mac/MacSentrySubsystem.cpp
136138
Source/Sentry/Private/Mac/MacSentrySubsystem.h
139+
Source/Sentry/Private/Mac/MacSentryUser.h
137140
Source/Sentry/Private/Microsoft/MicrosoftSentrySubsystem.cpp
138141
Source/Sentry/Private/Microsoft/MicrosoftSentrySubsystem.h
139142
Source/Sentry/Private/Null/NullSentryAttachment.h
@@ -185,6 +188,7 @@ Source/Sentry/Private/Windows/Infrastructure/WindowsSentryConverters.cpp
185188
Source/Sentry/Private/Windows/Infrastructure/WindowsSentryConverters.h
186189
Source/Sentry/Private/Windows/WindowsSentrySubsystem.cpp
187190
Source/Sentry/Private/Windows/WindowsSentrySubsystem.h
191+
Source/Sentry/Private/Windows/WindowsSentryUser.h
188192
Source/Sentry/Public/SentryAttachment.h
189193
Source/Sentry/Public/SentryBeforeBreadcrumbHandler.h
190194
Source/Sentry/Public/SentryBeforeSendHandler.h

scripts/packaging/package-marketplace.snapshot

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,10 +129,13 @@ Source/Sentry/Private/Interface/SentryUserFeedbackInterface.h
129129
Source/Sentry/Private/Interface/SentryUserInterface.h
130130
Source/Sentry/Private/IOS/IOSSentrySubsystem.cpp
131131
Source/Sentry/Private/IOS/IOSSentrySubsystem.h
132+
Source/Sentry/Private/IOS/IOSSentryUser.h
132133
Source/Sentry/Private/Linux/LinuxSentrySubsystem.cpp
133134
Source/Sentry/Private/Linux/LinuxSentrySubsystem.h
135+
Source/Sentry/Private/Linux/LinuxSentryUser.h
134136
Source/Sentry/Private/Mac/MacSentrySubsystem.cpp
135137
Source/Sentry/Private/Mac/MacSentrySubsystem.h
138+
Source/Sentry/Private/Mac/MacSentryUser.h
136139
Source/Sentry/Private/Microsoft/MicrosoftSentrySubsystem.cpp
137140
Source/Sentry/Private/Microsoft/MicrosoftSentrySubsystem.h
138141
Source/Sentry/Private/Null/NullSentryAttachment.h
@@ -184,6 +187,7 @@ Source/Sentry/Private/Windows/Infrastructure/WindowsSentryConverters.cpp
184187
Source/Sentry/Private/Windows/Infrastructure/WindowsSentryConverters.h
185188
Source/Sentry/Private/Windows/WindowsSentrySubsystem.cpp
186189
Source/Sentry/Private/Windows/WindowsSentrySubsystem.h
190+
Source/Sentry/Private/Windows/WindowsSentryUser.h
187191
Source/Sentry/Public/SentryAttachment.h
188192
Source/Sentry/Public/SentryBeforeBreadcrumbHandler.h
189193
Source/Sentry/Public/SentryBeforeSendHandler.h

0 commit comments

Comments
 (0)