aboutsummaryrefslogtreecommitdiffstats
path: root/src/net/instance.h
diff options
context:
space:
mode:
authorConfuSomu2024-03-20 13:28:19 -0400
committerConfuSomu2024-03-20 13:28:19 -0400
commit4e59eadba3b0d4586a9122e6a825ea030a139c9a (patch)
tree6674c2b23ef6295e7a8d60bb034c3321e7a5a996 /src/net/instance.h
parent0e32ef940e53c4f10d84762f2de6836025f87610 (diff)
downloadActorViewer-4e59eadba3b0d4586a9122e6a825ea030a139c9a.tar
ActorViewer-4e59eadba3b0d4586a9122e6a825ea030a139c9a.tar.gz
ActorViewer-4e59eadba3b0d4586a9122e6a825ea030a139c9a.zip
Use smart pointers with AP classes and Instance
Diffstat (limited to 'src/net/instance.h')
-rw-r--r--src/net/instance.h11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/net/instance.h b/src/net/instance.h
index 2b7eec7..79c0b12 100644
--- a/src/net/instance.h
+++ b/src/net/instance.h
@@ -1,6 +1,11 @@
#pragma once
#include "src/activitypub/appost.h"
#include "src/settings_interface.h"
+#include <QMetaType>
+#include <memory>
+
+class Instance;
+typedef std::shared_ptr<Instance> InstancePtr;
class Instance {
public:
@@ -10,7 +15,7 @@ public:
};
virtual ~Instance() {};
- virtual APPost* get_post_from_url(const QString &url) = 0;
+ virtual APPostPtr get_post_from_url(const QString &url) = 0;
// Returns the URI the user has to visit in their browser
virtual QString oauth2_step1();
// auth_code is the code given by the user through the URI
@@ -18,7 +23,7 @@ public:
virtual OAuth2Step2 oauth2_step2(const QString &auth_code);
bool supports_oauth2 = false;
// Creates an instance by reading the type from settings
- static Instance* create_instance();
+ static InstancePtr create_instance();
// Creates a specific type of instance, for use with SettingsDialog
- static Instance* create_instance(AppSettingsTypes::InstanceType type);
+ static InstancePtr create_instance(AppSettingsTypes::InstanceType type);
};