diff options
author | ConfuSomu | 2023-07-05 15:24:07 +0200 |
---|---|---|
committer | ConfuSomu | 2023-07-06 00:33:30 +0200 |
commit | 9b70e3c5a208a881188bc6468fe27933cbdb02f8 (patch) | |
tree | 85041878bfd250232284f831663b1a611e902521 | |
parent | e515ca109faa897e84be8a97a1240c59df612dd4 (diff) | |
download | ActorViewer-9b70e3c5a208a881188bc6468fe27933cbdb02f8.tar ActorViewer-9b70e3c5a208a881188bc6468fe27933cbdb02f8.tar.gz ActorViewer-9b70e3c5a208a881188bc6468fe27933cbdb02f8.zip |
Move implementation detail functions into Archive
These functions were in archive_parser.cpp's compilation unit which has
only functions related to the Archive class but it is better to make
them private members of Archive as they are implementation details of
this class to make the link more clear.
-rw-r--r-- | src/archive_parser.cpp | 8 | ||||
-rw-r--r-- | src/archive_parser.h | 4 |
2 files changed, 8 insertions, 4 deletions
diff --git a/src/archive_parser.cpp b/src/archive_parser.cpp index f8b9179..77d3ec0 100644 --- a/src/archive_parser.cpp +++ b/src/archive_parser.cpp @@ -59,7 +59,7 @@ Archive::~Archive() { delete outbox_items; outbox_items = nullptr; } -bool is_status_type_allowed(StatusType status_type, ViewStatusTypes allowed_types) { +bool Archive::is_status_type_allowed(StatusType status_type, ViewStatusTypes allowed_types) { switch (status_type) { case PUBLIC: return allowed_types.includePublic; case UNLISTED: return allowed_types.includeUnlisted; @@ -71,7 +71,7 @@ bool is_status_type_allowed(StatusType status_type, ViewStatusTypes allowed_type } // specific to Mastodon ActivityStreams archives -StatusType get_status_type(QJsonObject obj) { +StatusType Archive::get_status_type(QJsonObject obj) { /* * public: * to: #Public @@ -173,7 +173,7 @@ void Archive::update_status_list(ViewStatusTypes allowed_types, QListWidget *par } } -QStringList get_status_object_list(QJsonObject obj, QString element_name) { +QStringList Archive::get_status_object_list(QJsonObject obj, QString element_name) { QStringList list; if (obj.contains(element_name)) { @@ -186,7 +186,7 @@ QStringList get_status_object_list(QJsonObject obj, QString element_name) { return list; } -QStringList get_status_object_language_list(QJsonObject obj, QString element_name = "contentMap") { +QStringList Archive::get_status_object_language_list(QJsonObject obj, QString element_name = "contentMap") { QStringList list; if (obj.contains(element_name) and obj.value(element_name).isObject()) { diff --git a/src/archive_parser.h b/src/archive_parser.h index d9313ee..c206087 100644 --- a/src/archive_parser.h +++ b/src/archive_parser.h @@ -43,6 +43,10 @@ private: QJsonObject *outbox_json = nullptr; QJsonArray *outbox_items = nullptr; + bool is_status_type_allowed(StatusType status_type, ViewStatusTypes allowed_types); + StatusType get_status_type(QJsonObject obj); + QStringList get_status_object_list(QJsonObject obj, QString element_name) ; + QStringList get_status_object_language_list(QJsonObject obj, QString element_name); std::vector<APAttachmentFields> get_status_attachments_list(QJsonValueRef attachments_ref); void find_attachment_dir(QString example_attachment); }; |