From 3e99b90c0b7bbd6b2620af099fe503be41cecc0e Mon Sep 17 00:00:00 2001 From: Gerhard Stein Date: Sat, 9 Dec 2023 18:55:46 +0100 Subject: [PATCH] Some cleanps --- gpt4all-chat/chat.cpp | 5 ----- gpt4all-chat/chat.h | 10 +++++----- gpt4all-chat/chatlistmodel.cpp | 3 --- gpt4all-chat/chatlistmodel.h | 6 +++--- 4 files changed, 8 insertions(+), 16 deletions(-) diff --git a/gpt4all-chat/chat.cpp b/gpt4all-chat/chat.cpp index 17a92cf9..0d9b7bc4 100644 --- a/gpt4all-chat/chat.cpp +++ b/gpt4all-chat/chat.cpp @@ -10,14 +10,9 @@ Chat::Chat(QObject *parent) , m_id(Network::globalInstance()->generateUniqueId()) , m_name(tr("New Chat")) , m_chatModel(new ChatModel(this)) - , m_responseInProgress(false) , m_responseState(Chat::ResponseStopped) , m_creationDate(QDateTime::currentSecsSinceEpoch()) , m_llmodel(new ChatLLM(this)) - , m_isServer(false) - , m_shouldDeleteLater(false) - , m_isModelLoaded(false) - , m_shouldLoadModelWhenInstalled(false) , m_collectionModel(new LocalDocsCollectionsModel(this)) { connectLLM(); diff --git a/gpt4all-chat/chat.h b/gpt4all-chat/chat.h index 30308f42..5d72222d 100644 --- a/gpt4all-chat/chat.h +++ b/gpt4all-chat/chat.h @@ -155,15 +155,15 @@ private: QString m_response; QList m_collections; ChatModel *m_chatModel; - bool m_responseInProgress; + bool m_responseInProgress = false; ResponseState m_responseState; qint64 m_creationDate; ChatLLM *m_llmodel; QList m_databaseResults; - bool m_isServer; - bool m_shouldDeleteLater; - bool m_isModelLoaded; - bool m_shouldLoadModelWhenInstalled; + bool m_isServer = false; + bool m_shouldDeleteLater = false; + bool m_isModelLoaded = false; + bool m_shouldLoadModelWhenInstalled = false; LocalDocsCollectionsModel *m_collectionModel; }; diff --git a/gpt4all-chat/chatlistmodel.cpp b/gpt4all-chat/chatlistmodel.cpp index 0b295fab..8ad02898 100644 --- a/gpt4all-chat/chatlistmodel.cpp +++ b/gpt4all-chat/chatlistmodel.cpp @@ -16,9 +16,6 @@ ChatListModel *ChatListModel::globalInstance() ChatListModel::ChatListModel() : QAbstractListModel(nullptr) - , m_newChat(nullptr) - , m_serverChat(nullptr) - , m_currentChat(nullptr) { addChat(); diff --git a/gpt4all-chat/chatlistmodel.h b/gpt4all-chat/chatlistmodel.h index 8f4b1c2e..20729204 100644 --- a/gpt4all-chat/chatlistmodel.h +++ b/gpt4all-chat/chatlistmodel.h @@ -239,9 +239,9 @@ private Q_SLOTS: } private: - Chat* m_newChat; - Chat* m_serverChat; - Chat* m_currentChat; + Chat* m_newChat = nullptr; + Chat* m_serverChat = nullptr; + Chat* m_currentChat = nullptr; QList m_chats; private: