From 9c58913ee2377ebaf1e2a3b7e946b57e29d37935 Mon Sep 17 00:00:00 2001 From: dsc Date: Wed, 30 Aug 2023 00:42:23 +0300 Subject: [PATCH] update onion URL to new server, fix forum listing --- src/CMakeLists.txt | 3 ++- src/appcontext.cpp | 6 +++--- src/appcontext.h | 2 +- src/model/ForumModel.cpp | 10 +++++----- src/model/ForumModel.h | 2 +- src/widgets/ForumPost.h | 6 +++--- 6 files changed, 15 insertions(+), 14 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 42c3655..c15f220 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -246,7 +246,8 @@ target_link_libraries(wowlet PUBLIC ${OPENSSL_LIBRARIES} ${CMAKE_DL_LIBS} ${Iconv_LIBRARIES} - /usr/local/lib/libunbound.a + ${UNBOUND_LIBRARIES} +# /usr/local/lib/libunbound.a ${EXTRA_LIBRARIES}) # Link Qt libraries diff --git a/src/appcontext.cpp b/src/appcontext.cpp index caa8f8f..7389e83 100644 --- a/src/appcontext.cpp +++ b/src/appcontext.cpp @@ -554,10 +554,10 @@ void AppContext::onWSForum(const QJsonArray& forum_data) { for (auto &&entry: forum_data) { auto obj = entry.toObject(); auto forumPost = new ForumPost( - obj.value("title").toString(), - obj.value("author").toString(), + obj.value("thread").toString(), + obj.value("member_name").toString(), obj.value("permalink").toString(), - obj.value("comments").toInt()); + obj.value("member_name").toString()); QSharedPointer r = QSharedPointer(forumPost); l.append(r); } diff --git a/src/appcontext.h b/src/appcontext.h index 45fda0e..23a2326 100644 --- a/src/appcontext.h +++ b/src/appcontext.h @@ -67,7 +67,7 @@ public: QString tmpTxDescription; // https://git.wownero.com/wowlet/wowlet-backend/ - QString backendHost = "6wku2m4zrv6j666crlo7lzofv6ud6enzllyhou3ijeigpukymi37caad.onion"; + QString backendHost = "l3hkasj5nnrh24yzj4acj5dgqlscq56o5xjvvqsftj55fkonqly5aiid.onion"; unsigned int backendPort = 80; bool backendTLS = false; QString backendWSUrl; diff --git a/src/model/ForumModel.cpp b/src/model/ForumModel.cpp index be32d11..998a1c6 100644 --- a/src/model/ForumModel.cpp +++ b/src/model/ForumModel.cpp @@ -56,15 +56,15 @@ QVariant ForumModel::data(const QModelIndex &index, int role) const return post->title; case Author: return post->author; - case Comments: - return QString::number(post->comments); + case DateAdded: + return post->date_added; default: return QVariant(); } } else if (role == Qt::TextAlignmentRole) { switch(index.column()) { - case Comments: + case DateAdded: return Qt::AlignRight; default: return QVariant(); @@ -85,8 +85,8 @@ QVariant ForumModel::headerData(int section, Qt::Orientation orientation, int ro return QString("Forum Post"); case Author: return QString("Author"); - case Comments: - return QString("Comments"); + case DateAdded: + return QString("Date"); default: return QVariant(); } diff --git a/src/model/ForumModel.h b/src/model/ForumModel.h index 9fe18b2..4f2f0ed 100644 --- a/src/model/ForumModel.h +++ b/src/model/ForumModel.h @@ -18,7 +18,7 @@ public: { Title = 0, Author, - Comments, + DateAdded, COUNT }; diff --git a/src/widgets/ForumPost.h b/src/widgets/ForumPost.h index ca4f3ee..f6fa099 100644 --- a/src/widgets/ForumPost.h +++ b/src/widgets/ForumPost.h @@ -7,13 +7,13 @@ #include struct ForumPost { - ForumPost(const QString &title, const QString &author, const QString &permalink, int comments) - : title(title), author(author), permalink(permalink), comments(comments){}; + ForumPost(const QString &title, const QString &author, const QString &permalink, const QString date_added) + : title(title), author(author), permalink(permalink), date_added(date_added){}; QString title; QString author; QString permalink; - int comments; + QString date_added; }; #endif //WOWLET_FORUMPOST_H