From 9b70e3c5a208a881188bc6468fe27933cbdb02f8 Mon Sep 17 00:00:00 2001 From: ConfuSomu Date: Wed, 5 Jul 2023 15:24:07 +0200 Subject: 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. --- src/archive_parser.cpp | 8 ++++---- src/archive_parser.h | 4 ++++ 2 files changed, 8 insertions(+), 4 deletions(-) (limited to 'src') 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 get_status_attachments_list(QJsonValueRef attachments_ref); void find_attachment_dir(QString example_attachment); }; -- cgit v1.2.3-54-g00ecf